-
Notifications
You must be signed in to change notification settings - Fork 37
Remove _deprecated_scope_block
on AssociationRelation
#21
Remove _deprecated_scope_block
on AssociationRelation
#21
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. I have left some comments.
lib/active_record/mass_assignment_security/association_relation.rb
Outdated
Show resolved
Hide resolved
2024afd
to
73bcc12
Compare
73bcc12
to
1efbf6f
Compare
PR that makes the original change in behaviour - rails/rails#29301 was merged on June 28, 2017. Was merged before Rails 5.1.3 but I think was only released for 5.2.0 (rails/rails#33387). PR which removes the scoping block - rails/rails#33394 was merged on July 19, 2018. Would be included in Rails 5.2.1 I think that lets keep the |
@westonganger Done! Let me know if you find anything else worth addressing. |
@foxlance you added the scoping back for all Rails versions. We want the scoping block to be removed for Rails 5.2+. |
@westonganger Is the recent commit what you have in mind? |
Merged. Thanks for your contribution. |
v1.8.0 is now released which contains this fix. |
Fixes a regression from westonganger#21 where the scoping block was removed.
Fixes a regression from westonganger#21 where the scoping block was removed.
This fix addresses the
NoMethodError: undefined method _deprecated_scope_block for ActiveRecord::AssociationRelation
error one might encounter when using.first_or_create
, and possibly.first_or_initialize
after awhere
clause on an association, e.g.This bug is specific to Rails 6.1.x with protected_attributes_continued v1.7.0. Downgrading to protected_attributes_continued v1.6.0 works if one is not after any specific 1.7.0 features.
This fix is inspired by rails/rails@255a7ef.