rails / protected_attributes

Protect attributes from mass-assignment in ActiveRecord models.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot use :as with .new with child objects - ArgumentError: wrong number of arguments (2 for 0..1)

espen opened this issue · comments

  1. List has_many items.
  2. Using list.items.create({}, :as => :admin) works.
  3. Using list.items.new({}, :as => :admin) works in Rails3 gives error with this gem: 'ArgumentError: wrong number of arguments (2 for 0..1)'

See failing test at https://github.com/espen/protected_attributes_new_bug

Great! This makes me think that GitHub should have a "notify me when this commit is included in gem release" feature though.