Skip to content
New issue

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

Fix crash with protected_attributes and rails 4.2 #14

Merged
merged 1 commit into from Jul 15, 2015

Conversation

brauliobo
Copy link

No description provided.

@sneakernets
Copy link

Thanks for figuring this out!

@pothoven
Copy link
Owner

Thanks for the fix!
Before I pull it in, I noticed you removed checks and alternative code for various Rails versions. Will this work for all versions? Other than needing to switch the assignment syntax back to ":content_type =>" instead of the newer "content_type:" to ensure back-level compatibility, I would think it should work.

@pothoven
Copy link
Owner

There was already another proposed fix for this problem in this pull request (#13) that I hadn't seen until I saw yours. Any thoughts on it compared to yours?

@brauliobo
Copy link
Author

This PR uses the send("#{attr}=", value) which is agnotisc of where the protected_attributes is being used or not. This also simplified the code and made the version check not necessary anymore.

@pothoven
Copy link
Owner

I agree. While I like that PR #13 was able to fix it with a 1 liner, I like that your fix also simplified the code. I'll pull in your fix and make a new version of the gem.

pothoven added a commit that referenced this pull request Jul 15, 2015
Fix crash with protected_attributes and rails 4.2
@pothoven pothoven merged commit f79f416 into pothoven:master Jul 15, 2015
@brauliobo
Copy link
Author

thanks @pothoven, I'll remove the monkey patch in my code :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants