Avram::SaveOperation(T)
Inherits Avram::AddColumnAttributes < Avram::Upsert < Avram::InheritColumnAttributes < Avram::MarkAsFailed < Avram::NestedSaveOperation < Avram::DatabaseValidations < Avram::SaveCallbacks < Avram::AfterCommitCallback < Avram::CallbackHelpers < Avram::NeedyInitializerAndSaveMethods < Avram::ParamKeyOverride < Avram::OperationErrors < Avram::Validations < Avram::DefineAttribute < Reference < Object
Constants
Constructors
Class methods
Performs a create or update depending on if there is a conflicting row in the database.
See Avram::Upsert.upsert_lookup_columns for full documentation and examples.
Performs a create or update depending on if there is a conflicting row in the database.
See Avram::Upsert.upsert_lookup_columns for full documentation and examples.
Instance methods
A helper method to backfill accessing the database before they were split in to read/write methods
#persisted? always returns true in after_* hooks, whether
a new record was created, or an existing one was updated.
This method should always return true for a create or false
for an update, independent of the stage we are at in the operation.
Runs all required validations for required types as well as any additional valitaions the type needs to run e.g. polymorphic validations
Runs required validation,
then returns true if all attributes are valid,
and there's no custom errors
Macros
This allows you to skip the default validations which may be used as an escape hatch when you want to allow storing an empty string value.