Hi, all!
May you ever feel happy!
I''m getting some very strange behaviour and I''m not sure where
my
mistake lies.
I have a Divination model that belongs_to :book.
I get the following in script/console:>> d = Divination.find(7) # => #<Divination id: 7, user_id: 1,
book_id: 4...
>> d.book # => #<Book id: 4...
Now if I change the book:>> d.book = Book.find(5) # => #<Book id: 5...
>> d.book # => #<Book id: 4
# It''s still the same!
Now I try to change the book_id:>> d.book_id = 6 # => 6
>> d.book_id # => 6
Wow! It changed!>> d.book # => #<Book id: 4
But alas! The book is the same!
It certainly shouldn''t be this way, should it? Or am I missing
something
very important?
Yours,
Damian
P.S. It is Rails 2.0.2 on Mac OS X 10.5 Leopard
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---