class Post
has_one :author, :autosave => true
end
The autosave will take care of saving associations when the parent is
saved.
On May 28, 2:19 pm, Milan Dobrota
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Having one to many connection (for example post has many comments), what
> is the most efficient way of saving all comments when post is saved.
> Using after_save on Post would introduce the n+1 problem. Is there any
> way of saving the whole structure at once?
> --
> Posted viahttp://www.ruby-forum.com/.