views:

15

answers:

0

Using rails, consider:

> p = Post.new
> p.author = Person.find(1)
> p.author_id = 99
> p.author_id
 => 99
> p.author
 => #<Person id:1, name: "Person 1">

What I've never understood: is there a conscious decision cq some reasoning behind not clearing the +author+ value after the +author_id+ is set? Is there a plugin of some sorts that fixes this?