Use the hook_class_methods plugin for backwards compatibility
masterThe hook_class_methods plugin allows you to define model hooks using class methods with blocks or tags.
Note: This plugin is intended for backwards compatibility and its use is not encouraged. The recommended way to add hooks in Sequel is to override the instance method and call super.
Recommended Approach (Instance Methods)
def before_save
super
self.created_at = Time.now
endPlugin Usage
To enable this plugin for all model subclasses:
Sequel::Model.plugin :hook_class_methodsTo enable it for a specific class:
Album.plugin :hook_class_methods