Forum: Ruby on Rails script/console : modify an attribute

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
007bac1f27905cd4d5d88315e9b0093a?d=identicon&s=25 Guillaume Loader (loader)
on 2009-02-19 18:23
Hello everyone! :)

I would like to know how to modify a variable in the console?

I did this :
e = Entry.find(:first)
e.dev.community.name = "Ruby Geeks"
e.save

But when I look into my database, the variable didn't changed. Did I
mystype?

Thank you :)
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-02-19 18:48
(Received via mailing list)
On 19 Feb 2009, at 17:23, Guillaume Loader wrote:

> But when I look into my database, the variable didn't changed. Did I
> mystype?
>
you didn't save the right object  - e.dev.community.save would

Fred
This topic is locked and can not be replied to.