westonganger / protected_attributes_continued

The community continued version of protected_attributes for Rails 5+
MIT License
45 stars 33 forks source link

Preserve scoping when building associations with conditions #24

Closed avit closed 3 years ago

avit commented 3 years ago

With 1.8.0, #21 introduced a change that no longer preserves values from the scope chain on associations:

membership = group.memberships.where(pirate_id: 1).build
membership.pirate_id  # expected: 1, got nil
westonganger commented 3 years ago

v1.8.1 is now release which contains this fix.

avit commented 3 years ago

FYI changelog for 1.8.1 doesn't list this #24. Maybe linking to the wrong issue #23 there?

westonganger commented 3 years ago

Thanks for pointing that out. Ive fixed the changelog now.