rails / protected_attributes

Protect attributes from mass-assignment in ActiveRecord models.
MIT License
228 stars 92 forks source link

Don't understand how this gem can work with rails 4 (cross-post) #90

Closed h0jeZvgoxFepBQ2C closed 7 years ago

h0jeZvgoxFepBQ2C commented 7 years ago

Hi,

I'm having following problems: https://github.com/attr-encrypted/attr_encrypted/issues/246

And i really don't understand how the "protected_attributes" gem can work, because it uses following method (with 2! parameters):

assign_attributes(attributes, options)

But in ActiveRecord 4 there is no method like this - because the only assign_attributes method has following signature (1! parameter):

# activerecord-4.2.7.1/lib/active_record/attribute_assignment.rb
   ...
    def assign_attributes(new_attributes)

Can someone give me a hint how this can work? And why I get this error, even if the gems themselfes should work fine with rails 4.2? Thanks :(

h0jeZvgoxFepBQ2C commented 7 years ago

I removed this gem, my problem was solved.. but i couldnt found the reason.