class Product < ActiveRecord::Base
include NestedAttributes
belongs_to :store
accepts_nested_attributes_for :store, reject_if: ->(_) { raise "This never raises" }
end
product = Product.new
product.update(store_attributes: { bicycles: {} })
I traced the issue down to the call_reject_if method redefinition inside NestedAttributes mix-in here:
Renaming the method in this gem to something else, like call_store_model_reject_if, fixes the issue.
Minimal example
I traced the issue down to the call_reject_if method redefinition inside NestedAttributes mix-in here:
https://github.com/DmitryTsepelev/store_model/blob/master/lib/store_model/nested_attributes.rb#L141
The parameters don't match the method parameters inside the ActiveRecord mix-in:
https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activerecord/lib/active_record/nested_attributes.rb#L598
Renaming the method in this gem to something else, like call_store_model_reject_if, fixes the issue.