Monday, January 7, 2013

[Rails] Re: Mass-assignment notification with whiltelist_attributes set to true

On Jan 7, 5:43 pm, Ilya Katz <ilyak...@gmail.com> wrote:

> I found it useful for my development to make 2 changes
>
> 1. Update log message to be more explicit such as  "WARNING: Can't
> mass-assign *in SomeModel* protected attributes: blah"
> 2. Thrown an exception - this would only make sense if whitelist_attributes
> is set to true
>
> Any opinion if this would be a good suggestion for the rails feature
> request, specifically #2?
>

#2 already exists:

config.active_record.mass_assignment_sanitizer = :strict

will turn on exception raising. A better error message wouldn't hurt
though

Fred
> Thanks

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate