Wednesday, 15 February 2012

Custom helper methods for Rails 3.2 Migrations -


I am trying to access helpful methods within my migration. Migration file:

  is required File.expand_path ('lib / migrations_helper') is included in the MigrationHelper category:  

NewTable & lt; ActiveRecord :: Migration Def changed_ create_table: new_table do | T | T.boolean: Boolean safe_delete_m methods end end

Migration Helper in / lib directory

  # Custom module available for migration migration Helper Def SafeDelete_MathalsT .Boline: deleted, default => 0,: Cord = & gt; False t.integer: deleted_by ,: default = & gt; 0,: Cord = & gt; Wrong t.datetime: deleted_at end end   

Thanks for any reply

  Module travelsManaged def safe_delete_himops t. Boolean: Deleted: Default = & gt; 0,: Cord = & gt; False t.integer: deleted_by ,: default = & gt; 0,: Cord = & gt; Wrong t.datetime: deleted_at end end   

Can not use the refund before the code.

No comments:

Post a Comment