class Sequel::Model::DatasetModule
This Module subclass is used by Model.dataset_module to add dataset methods to classes. In addition to the methods offered by Dataset::DatasetModule
, it also automatically creates class methods for public dataset methods.
Attributes
The model class related to this dataset module.
Public Class Methods
Source
# File lib/sequel/model/dataset_module.rb 15 def initialize(model) 16 @model = model 17 end
Store the model related to this dataset module.
Public Instance Methods
Source
# File lib/sequel/model/dataset_module.rb 20 def subset(name, *args, &block) 21 where(name, *args, &block) 22 end
Alias for where.
Private Instance Methods
Source
# File lib/sequel/model/dataset_module.rb 28 def method_added(meth) 29 @model.send(:def_model_dataset_method, meth) if public_method_defined?(meth) 30 super 31 end
Add a class method to the related model that calls the dataset method of the same name.
Calls superclass method