rails / protected_attributes

Protect attributes from mass-assignment in ActiveRecord models.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rails 4.2 HasManyThroughAssociation build_record arity mismatch

tonywok opened this issue · comments

Hey there, thanks for the gem.

I know that the current release only claims to support rails 4.1, but I figured I'd mention an issue I'm having on rails 4.2 (amidst an upgrade from 3.2 :)

In rails 4.1 Associations::HasManyThroughAssociation defines build_record(attributes, options={}) whereas rails 4.2 defines build_record(attributes), so protected_attributes' super call causes an ArgumentError.

I'd be happy to take a stab at fixing, but wanted to know your plans on supporting rails 4.2 before diving in. Monkey patching for now.

UPDATE

On second thought, if this gem is to be supported until rails 5.0, perhaps the fix needs to be in rails 4.2? Their arity change breaks this gem.

Ah, looks like I just needed to update. Closing.