method

before_save

before_save()
public

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

1Note

Saving other objects inside before_save

maratk ยท Feb 25, 20101 thank

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