Not able to use block-setting of attributes via association

I just created a ticket for this issue, but I thought it worth
bringing it up here as well:

The issue is that you can't set attributes with a block if you do so
through an association. So, while the following would set the body of
the Post to "body":

Post.create(:title => 'my post') { |p| p.body = "body" }

...this would not:

User.last.posts.create(:title => 'my post') { |p| p.body = "body" }

This ticket could be viewed as an enhancement request, of course, but
it seemed like something worth having in 2.1 to me.

My apologies, but I don't have the necessary Rails-internals-fu to add
a proper patch with a fix myself.

- Trevor

Note that one workaround seems to be: => 'my post') { |p| p.body = "body" }.save

- Trevor

I added a patch to the ticket. Both "create" and "create!" are