songkick / oauth2-provider

Simple OAuth 2.0 provider toolkit
MIT License
528 stars 148 forks source link

Remove `attr_accessible` for Rails 4 compatibility. #62

Open felixclack opened 11 years ago

felixclack commented 11 years ago

Using this with Rails 4 raises an error on attr_accessible as it is removed, in favour of strong_params.

The onus is now on the implementer to only permit name and redirect_uri when creating an authorization.

danielevans commented 11 years ago

This fixes the issue for me as well. Thanks!

jcoglan commented 10 years ago

We did work to make this work on ActiveRecord 4.0 a while ago, and the build is passing. Do you have a test case that fails?

danielevans commented 10 years ago

You can demonstrate the problem by spinning up a bare rails app with a single model and including the ResourceOwner module.

You can see this gist for a complete recreation script: https://gist.github.com/danielevans/7107532

nicosuria commented 10 years ago

FYI: The exact error given is

.rvm/gems/ruby-1.9.3-p448@auth/gems/activemodel-4.0.0/lib/active_model/deprecated_mass_assignment_security.rb:17:in `attr_accessible': `attr_accessible` is extracted out of Rails into a gem. Please use new recommended protection model for params(strong_parameters) or add `protected_attributes` to your Gemfile to use old one. (RuntimeError)

from /Users/xxxxx/.rvm/gems/ruby-1.9.3-p448@xxxxx/gems/songkick-oauth2-provider-0.10.2/lib/songkick/oauth2/model/client.rb:18:in `<class:Client>'
myitcv commented 10 years ago

+1

andrewpbrett commented 10 years ago

Any reason this isn't merged yet? I can also confirm it's an issue with Rails 4.

myitcv commented 10 years ago

Any update?

davidpiegza commented 10 years ago

I have the same problem, any update?

kritik commented 10 years ago

+1

jbye commented 10 years ago

+1. Any updates?

d-natoli commented 10 years ago

+1

jgrevich commented 10 years ago

:+1: any ETA as to when this will be merged?