[Rails] Re: Ignore attr_accessible in seed file

2012-06-22 Thread Lori Olson
Just to save the next person the aggravation of figuring this out, Sanitizer is a class now, not a module, and the sanitize method takes two parameters. So you need this: module ActiveModel module MassAssignmentSecurity class Sanitizer def sanitize(attributes, authorizer) a

[Rails] Re: Ignore attr_accessible in seed file

2011-02-05 Thread Markus Proske
Bit hacky but you could override > remove_attributes_protected_from_mass_assignment or overwrite the > attribute containing the list of protected attributes > Thank you! I did not find the remove_attributes_protected..., but did find an interesting method sanitize here: rails

[Rails] Re: Ignore attr_accessible in seed file

2011-02-04 Thread Frederick Cheung
On Feb 4, 8:51 am, Markus Proske wrote: > On Thursday, February 3, 2011 11:58:23 PM UTC+1, Ruby-Forum.com User wrote: > > > Here's one way I found a quick Google search: > > >http://stackoverflow.com/questions/4838716/how-to-avoid-the-validatio... > > Thank you. I've already been there and this

[Rails] Re: Ignore attr_accessible in seed file

2011-02-04 Thread Markus Proske
On Thursday, February 3, 2011 11:58:23 PM UTC+1, Ruby-Forum.com User wrote: > > Here's one way I found a quick Google search: > > > http://stackoverflow.com/questions/4838716/how-to-avoid-the-validation-callbacks-and-attr-accessible-effects-during-the-s > Thank you. I've already been there and this

[Rails] Re: Ignore attr_accessible in seed file

2011-02-03 Thread Robert Walker
Markus Proske wrote in post #979510: > Is there a way to tell Rails to ignore attr_accessible when seeding the > database and to allow mass assignment with create or new? > I know how to skip validations but do not find anything on mass > assignment... Here's one way I found a quick Google search: