Undistraction
Undistraction

Reputation: 43402

Active Record Autosave In Reverse Direction

Using autosave: true on a has_one or has_many association means that when the parent record is saved, its association(s) are saved as well.

But what if I need the parent to be saved whenever (any of) its association(s) are saved?

Upvotes: 0

Views: 124

Answers (1)

Daniël Zwijnenburg
Daniël Zwijnenburg

Reputation: 2560

You can also use autosave:true on a belongs_to relationship to automatically save the parent.

Upvotes: 1

Related Questions