Closed antlypls closed 10 years ago
0.7.4 released.
Tried 0.7.4. The issue is still there.
It's very unlikely. 0.7.4 has the spec for your case. It's green. Same goes to your sample – it works here.
Ha! I figured it out. My example shows issue for create!
method, your test checks create
method.
So add expect{ dummy.restrict!.create!(params(string: 'test')).delete }.to_not raise_error
to engine_spec, and you'll get ActiveModel::ForbiddenAttributesError
.
:scream:
Can you please check master before I release .5?
Original issue is fixed.
But I noticed similar problem for create!
on association.
Code like blog.restrict!(true).posts.create!(params[:post])
raises same error.
I can write more detailed sample if needed.
yeah if you can write a spec that would be awesome
Ok. Let's keep this one as closed, i'll submit problem with association in separate issue. Releasing .5 is up to you. It makes sense for me to wait, until all issues related to strong parameters will be fixed.
Yep. We'll wait.
Shortly speaking,
Model.restrict!(context).create!(params[:model])
throwsActiveModel::ForbiddenAttributesError
exception.Now more detailed example. Consider following
Blog
model withname
attribute.The following test fails with
ActiveModel::ForbiddenAttributesError
(rails 4.0.2 and protector 0.7.2).It looks like it's possible to create new record only using
new
andsave
.