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