We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Minimal example
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:
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.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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.
The text was updated successfully, but these errors were encountered: