method

before_save

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 1 note - Class: ActiveRecord::Callbacks

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v2.3.8) is shown here.

These similar methods exist in v7.1.3.2:

before_save() public

Is called before Base.save (regardless of whether it’s a create or update save).

Show source
Register or log in to add new notes.
February 25, 2010
1 thank

Saving other objects inside before_save

Don’t call .save or .update_attribute on other objects inside before_save callback.

Saving other objects inside of before_save callback results in flushing changed hash and the original object is not updated.

UPDATE observed sometimes, still investigating