abstract class Avram::DeleteOperation(T)
- Avram::DeleteOperation(T)
- Reference
- Object
Included Modules
- Avram::Callbacks
- Avram::DefineAttribute
- Avram::InheritColumnAttributes
- Avram::NeedyInitializerAndDeleteMethods
- Avram::OperationErrors
- Avram::ParamKeyOverride
- Avram::Validations
Defined in:
avram/delete_operation.crConstant Summary
-
ATTRIBUTES =
[] of Nil
-
OPERATION_NEEDS =
[] of Nil
Class Method Summary
- .destroy(*args, **named_args)
- .destroy(*args, **named_args, &)
- .destroy!(*args, **named_args)
- .destroy!(*args, **named_args, &)
- .param_key
Instance Method Summary
- #after_delete(_record : T)
- #before_delete
- #custom_errors
- #delete : Bool
- #delete!
-
#deleted?
Returns true if the operation has run and saved the record successfully
- #mark_as_deleted
- #mark_as_failed
-
#valid?
Returns
true
if all attributes are valid, and there's no custom errors
Macro Summary
Instance methods inherited from module Avram::OperationErrors
add_error(key : Symbol, message : String) : Nil
add_error,
errors : Hash(Symbol, Array(String))
errors
Instance methods inherited from module Avram::Validations
validate_acceptance_of(attribute : Avram::Attribute(Bool), message : Avram::Attribute::ErrorMessage = "must be accepted")
validate_acceptance_of,
validate_at_most_one_filled(*attributes, message : Avram::Attribute::ErrorMessage = "must be blank")
validate_at_most_one_filled,
validate_confirmation_of(attribute : Avram::Attribute(T), with confirmation_attribute : Avram::Attribute(T), message : Avram::Attribute::ErrorMessage = "must match") forall T
validate_confirmation_of,
validate_exactly_one_filled(*attributes, message : Avram::Attribute::ErrorMessage = "at least one must be filled")
validate_exactly_one_filled,
validate_inclusion_of(attribute : Avram::Attribute(T), in allowed_values : Enumerable(T), message : Avram::Attribute::ErrorMessage = "is invalid", allow_nil : Bool = false) forall T
validate_inclusion_of,
validate_numeric(attribute : Avram::Attribute(Number), greater_than = nil, less_than = nil, message = nil, allow_nil : Bool = false)
validate_numeric,
validate_required(*attributes, message : Avram::Attribute::ErrorMessage = "is required")
validate_required,
validate_size_of(attribute : Avram::Attribute(String), min = nil, max = nil, message = nil, allow_nil : Bool = false)validate_size_of(attribute : Avram::Attribute(String), *, is exact_size, message : Avram::Attribute::ErrorMessage = "is invalid", allow_nil : Bool = false) validate_size_of