brendon / acts_as_list

An ActiveRecord plugin for managing lists.
http://brendon.github.io/acts_as_list/
MIT License
2.04k stars 355 forks source link

add_new_at nil with scope causes NoMethodError #211

Closed greatghoul closed 8 years ago

greatghoul commented 8 years ago
acts_as_list scope: :brand_category, add_new_at: nil

When scope was set, error raised:

E, [2016-07-08T13:59:17.135900 #7403] ERROR -- : NoMethodError: undefined method `add_to_list_' for #<Item:0x007fea3942c748>
Did you mean?  add_to_transaction
  /vendor/bundle/ruby/2.3.0/gems/activemodel-4.2.6/lib/active_model/attribute_methods.rb:433:in `method_missing'
  /vendor/bundle/ruby/2.3.0/gems/acts_as_list-0.7.4/lib/acts_as_list/active_record/acts/list.rb:476:in `check_scope'

https://github.com/swanandp/acts_as_list/blob/master/lib/acts_as_list/active_record/acts/list.rb#L474