Forum: Ruby on Rails :has_many and :after_save

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Milan D. (Guest)
on 2009-05-28 13:19
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?
Mukund (Guest)
on 2009-05-28 14:26
(Received via mailing list)
class Post
    has_one :author, :autosave => true

The autosave will take care of saving associations when the parent is

On May 28, 2:19 pm, Milan D. <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.