Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Fix build_through_record for Rails >= 5.2.3 #14

Conversation

sebroeder
Copy link
Contributor

@sebroeder sebroeder commented May 16, 2019

After the change in rails/rails#35799 Rails does not call options_for_through_record anymore. This method was previously used by protected_attributes to pass in the without_protection: true option.

Override the build_through_record method instead and pass the option in there. Only override build_through_record for ActiveRecord versions >= 5.2.3.

After the change in rails/rails#35799 Rails 5.2.3+ does not call `options_for_through_record` anymore. This method was previously used by protected_attributes to pass in the `without_protection: true` option.

Override the `build_through_record` method instead and pass the option in there.

Only override `build_through_record` for ActiveRecord versions >= 5.2.3.
@westonganger westonganger merged commit 203a229 into westonganger:master May 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants