Wednesday 15 May 2013

ruby on rails - no implicit conversion of Symbol into Integer when migrating in production -


So I'm working on an existing app and for some reason I'm working on it and on my local environment However, when I try to flee on his thirst, I get an error?

Error:

  == 20141119113015 CreateReleasedInventoryStatus: migrating == ================ == - create_enum ("eh_released_inventory_status", ["rejected", "pending", "allocated", "issued", "transferred"]) aborted rake! StandardError: An error has occurred, and canceled the migration in the following: integer / app / vendor / bundle / ruby ​​/ 2.0.0 / gems / power_enum-2.8.0 / lib / power_enum / schema / schema_statements Any implicit conversion of symbols in rb: 84: in `[] '/app/vendor/bundle/ruby/2.0.0/gems/power_enum-2.8.0/lib/power_enum/schema/schema_statements.rb: 84: in` create_enum' / apps / Seller ' `/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:662:in /app/vendor/bundle/ruby/2.0.0/gems/activerecord- block method_missing 4.2.0 / lib / active_record / migration.rb: 632: '/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:632 in the block' say_with_time ' : ` '/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb: 652: in in` method_missing' /app/db/migrate/20141119113015_create_released_inventory_status.rb say_with_time : 3: `` exec_migration /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:606:in 'In Change / App / Seller / b undle / Dark red / 2 0.0 / gems / ActiveRecord-4.2.0 / lib / active_record / migration.rb: 590: `displaced 'block /app/vendor/bundle/ruby/2.0.0/gems (2 levels) /activerecord-4.2.0/ lib / active_record / migration.rb: 589: in block `displaced '/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/ Abstract / connection  

Migration file:

  Create classReliable status & lt; ActiveRecord :: Migration DEF create_enum ("eh_released_inventory_status", ["rejected", "pending", "allocated" "issued", "transferred"]) end of change  

I am also using the following gem:

  mani 'power_enum'  

Your travel syntax is going wrong for the power_enum gem that you are using.

Mani says that the syntax uses a name, then an option hash, such as:

  create_enum ("status", {...}) < / Code> 

You are using a name, then an array:

  create_enum ("eh_released_inventory_status", [...])  < / Pre> 

As far as I can tell, the solution is to change your migration line from what you have posted on the power_enum syntax, there is a bunch of examples in the README, and also It looks like it's completely and very good Is documented well.


No comments:

Post a Comment