class Sequel::Model
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.
Constants
- HOOKS
Empty instance methods to create that the user can override. Just like any other method defined by Sequel, if you override one of these, you should call
super
to get the default behavior (while empty by default, they are often overridden by plugins). See the “Model Hooks” guide for more detail on hooks.- OPTS
- RESTRICTED_SETTER_METHODS
The setter methods (methods ending with =) that are never allowed to be called automatically via
set
/update
/new
/etc.