Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration issues with Rails 4.2.1 #322

Closed
npearson72 opened this issue Apr 26, 2015 · 2 comments
Closed

Migration issues with Rails 4.2.1 #322

npearson72 opened this issue Apr 26, 2015 · 2 comments

Comments

@npearson72
Copy link

I'm getting the following error when I try to run my migrations (which work find in 4.1.9):

undefined method `add_money' for #<AddPricingToProduct:0x007f303025e218>/vagrant/db/migrate/20150321222026_add_pricing_to_product.rb:3:in `change'
NoMethodError: undefined method `add_money' for #<AddPricingToProduct:0x007f303025e218>
/vagrant/db/migrate/20150321222026_add_pricing_to_product.rb:3:in `change'
@JamesChevalier
Copy link
Member

There's a section in the README that might help you, if you're using PostgreSQL. (Although I'm a little worried that this might not be the cause of your issue, because I'm not sure I would expect an 'undefined method' error in this case.)

Notice for Rails >= 4.2 and PG adapter

Due to the addition of the money column type for PostgreSQL in Rails 4.2, you will need to use add_monetize instead of add_money column. If you're adding the column within a create_table block, use t.monetize, and use remove_monetize to remove the column.

@npearson72
Copy link
Author

That did the trick. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants