Jeremy Walker

Software Developer & Social Entrepreneur

Fixed Foreigner Gem to work with reversing migrations in Rails 3.1

The excellent foreigner gem doesn't quite work properly with the new reverse migrations of Rails 3.1. If you specify a column in the add_foreign_key call, the reverse remove_foreign_key_fails. i.e.

add_foreign_key :blogs, :posts, :column => :post_id

This results in:

An error has occurred, all later migrations canceled:
wrong number of arguments (3 for 2)

I've forked and fixed this at GitHub.

I've also sent a Pull Request so hopefully this will hit the main repository soon.

Share This Post


No-one has posted a comment yet. Be the first!

Post a Comment

I'd love to hear your thoughts :)