Sequel::Model
is an object relational mapper built on top of Sequel
core. Each model class is backed by a dataset instance, and many dataset methods can be called directly on the class. Model
datasets return rows as model instances, which are wrappers around the underlying hash that allow easily updating or deleting the individual row.
Sequel::Model
is built completely out of plugins. Plugins
can override any class, instance, or dataset method defined by a previous plugin and call super to get the default behavior. By default, Sequel::Model
loads two plugins, Sequel::Model
(which is itself a plugin) for the base support, and Sequel::Model::Associations
for the associations support.
You can set the SEQUEL_NO_ASSOCIATIONS
constant or environment variable to make Sequel
not load the associations plugin by default.
Classes and Modules
Constants
HOOKS | = | [ :after_create, :after_destroy, :after_save, :after_update, :after_validation, :before_create, :before_destroy, :before_save, :before_update, :before_validation ].freeze |
Empty instance methods to create that the user can override. Just like any other method defined by |
|
OPTS | = | Sequel::OPTS | ||
RESTRICTED_SETTER_METHODS | = | instance_methods.map(&:to_s).select{|l| l.end_with?('=')}.freeze |
The setter methods (methods ending with =) that are never allowed to be called automatically via |