The latest version of Rails introduces the convenience method "first"
in ActiveRecord, which acts as find(:first). This is breaking my
application wherever the following type of interaction takes place:
blog.posts.first.title = "New title"
When blog.save is called, an after_update hook will try to save the
associated posts. But since the line "blog.posts.first" loads a fresh
set of posts from the DB -- instead of accessing the in-memory cache
as in previous versions of Rails -- the change will not be saved.
The workaround is to say blog.posts instead.
I find this quite insidious, and I'm just curious whether other people
have encountered the same problem, and do you consider this a poor API
change on Rails' part?