rails_best_practices icon indicating copy to clipboard operation
rails_best_practices copied to clipboard

Bug in Rails 4.0.2 migration passing options to "add_column".

Open myfitment opened this issue 11 years ago • 2 comments

Same result on change_column. The following migration:

add_column :users, :admin, :boolean, { default: false, null: false }

causes the following error:

wrong number of arguments (2 for 1)/Users/me/.rvm/gems/ruby-2.0.0-p353@myapp/gems/rails_best_practices-1.15.0/lib/rails_best_practices/core_ext/object.rb:7:in `try'

That line of code in the gem is this declaration:

def try(method_symbol)

When I remove the gem from my Gemfile, migration worked.

myfitment avatar Feb 18 '14 01:02 myfitment

That's a known bug I accidentally introduced in 1.15.0. Try 1.15.1 See #202

bf4 avatar Feb 18 '14 01:02 bf4

Thanks! Just upgraded and fixed.

myfitment avatar Feb 18 '14 01:02 myfitment