Hi,
Is there a way to temporarily disable attr_protected for create and
save method calls?
Something like save_without_protected…
–
M.
Hi,
Is there a way to temporarily disable attr_protected for create and
save method calls?
Something like save_without_protected…
–
M.
On 29 Oct 2008, at 14:53, Marcelo B. wrote:
Hi,
Is there a way to temporarily disable attr_protected for create and
save method calls?Something like save_without_protected…
The bit to realise is that it’s not save that’s doing the protecting -
it’s the assigning to attributes.
Something like
foo = SomeObject.new
foo.send :attributes=, some_attributes, false
foo.save
will create a new instance of foo, ignoring protected attributes.
Fred
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs