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.
Store the model related to this dataset module.
# File lib/sequel/model/dataset_module.rb, line 12 def initialize(model) @model = model end
Alias for where.
# File lib/sequel/model/dataset_module.rb, line 17 def subset(name, *args, &block) where(name, *args, &block) end
Add a class method to the related model that calls the dataset method of the same name.
# File lib/sequel/model/dataset_module.rb, line 25 def method_added(meth) @model.send(:def_model_dataset_method, meth) if public_method_defined?(meth) super end