abstract class Marten::DB::Model
- Marten::DB::Model
- Reference
- Object
Included Modules
- Marten::Apps::Association
- Marten::Core::Validation
- Marten::Core::Validation::Callbacks
- Marten::DB::Model::AppConfig
- Marten::DB::Model::Callbacks
- Marten::DB::Model::Comparison
- Marten::DB::Model::Connection
- Marten::DB::Model::Inheritance
- Marten::DB::Model::Persistence
- Marten::DB::Model::Querying
- Marten::DB::Model::Table
- Marten::DB::Model::Validation
- Marten::Template::Object::Auto
Extended Modules
- Marten::DB::Model::AppConfig::ClassMethods
- Marten::DB::Model::Connection::ClassMethods
- Marten::DB::Model::Inheritance::ClassMethods
- Marten::DB::Model::Persistence::ClassMethods
- Marten::DB::Model::Querying::ClassMethods
- Marten::DB::Model::Table::ClassMethods
Direct Known Subclasses
Defined in:
marten/db/model.crmarten/db/model/app_config.cr
marten/db/model/callbacks.cr
marten/db/model/comparison.cr
marten/db/model/connection.cr
marten/db/model/inheritance.cr
marten/db/model/persistence.cr
marten/db/model/querying.cr
marten/db/model/table.cr
marten/db/model/table/field_context.cr
marten/db/model/table/reverse_relation_context.cr
marten/db/model/validation.cr
marten/template/ext/db/model.cr
Constant Summary
-
LOOKUP_SEP =
"__"
Constructors
- .new(kwargs : Hash | NamedTuple)
- .new(**kwargs)
- .new(kwargs : Hash | NamedTuple, &)
- .new(**kwargs, &)
Macros inherited from module Marten::Template::Object
template_attributes(*names)
template_attributes
Macros inherited from module Marten::DB::Model::Callbacks
after_commit(*names, **kwargs)
after_commit,
after_create(*names)
after_create,
after_create_commit(*names)
after_create_commit,
after_create_rollback(*names)
after_create_rollback,
after_delete(*names)
after_delete,
after_delete_commit(*names)
after_delete_commit,
after_delete_rollback(*names)
after_delete_rollback,
after_initialize(*names)
after_initialize,
after_rollback(*names, **kwargs)
after_rollback,
after_save(*names)
after_save,
after_save_commit(*names)
after_save_commit,
after_save_rollback(*names)
after_save_rollback,
after_update(*names)
after_update,
after_update_commit(*names)
after_update_commit,
after_update_rollback(*names)
after_update_rollback,
before_create(*names)
before_create,
before_delete(*names)
before_delete,
before_save(*names)
before_save,
before_update(*names)
before_update
Macros inherited from module Marten::Core::Validation::Callbacks
after_validation(*names)
after_validation,
before_validation(*names)
before_validation
Instance methods inherited from module Marten::Core::Validation
errors : ErrorSet
errors,
invalid?(context : Nil | String | Symbol = nil)
invalid?,
valid?(context : Nil | String | Symbol = nil)
valid?,
validate
validate
Macros inherited from module Marten::Core::Validation
validate(*names)
validate
Instance methods inherited from module Marten::DB::Model::Persistence
delete(using : Nil | String | Symbol = nil)
delete,
deleted?
deleted?,
new_record?
new_record?,
persisted?
persisted?,
reload
reload,
save(using : Nil | String | Symbol = nil, validate : Bool = true) : Bool
save,
save!(using : Nil | String | Symbol = nil, validate : Bool = true) : Bool
save!,
update(values : Hash | NamedTuple)update(**values) update, update!(values : Hash | NamedTuple)
update!(**values) update!
Instance methods inherited from module Marten::DB::Model::Comparison
<=>(other : self)
<=>,
==(other : self)
==
Instance methods inherited from module Marten::DB::Model::Table
get_field_value(field_name : String | Symbol)
get_field_value,
get_relation(relation_name : String | Symbol)
get_relation,
inspect(io)
inspect,
pk
pk,
pk!
pk!,
pk=(val)
pk=,
pk? : Bool
pk?,
set_field_value(field_name : String | Symbol, value : Field::Any | Model)
set_field_value,
set_field_values(values : Hash | NamedTuple)set_field_values(**values) set_field_values, to_s(io) to_s