Frederick Cheung wrote: > On Nov 18, 4:35�pm, nico Itkin <[EMAIL PROTECTED]> > wrote: >> => #<Guest id: 418519017, type: "Guest", ...#> >> g.update_attributes!(:type=>'Host') >> => true>> g >> >> => #<Guest id: 418519017, type: "Guest", ...#> >> >> #It seems that this "type" attribute is protected is there a way to >> by-pass this ? > Yup (and if you check your logs you'd probably see a warning about not > being able to mass assign a protected attribute) > > There's two things you can play with: Directly setting the type > attribute or playing with the becomes method. > > Fred
I had found update_attribute_with_validation_skipping which updates the protected attribute , but becomes is really what i need !! thanks a lot ! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

