Class: Sequel::Model::DatasetModule

Inherits:
Dataset::DatasetModule show all
Defined in:
lib/sequel/model/dataset_module.rb

Overview

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.

Direct Known Subclasses

Associations::DatasetModule

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Dataset::DatasetModule

def_dataset_caching_method

Constructor Details

#initialize(model) ⇒ DatasetModule

Store the model related to this dataset module.



15
16
17
# File 'lib/sequel/model/dataset_module.rb', line 15

def initialize(model)
  @model = model
end

Instance Attribute Details

#modelObject (readonly)

The model class related to this dataset module.



12
13
14
# File 'lib/sequel/model/dataset_module.rb', line 12

def model
  @model
end

Instance Method Details

#subset(name, *args, &block) ⇒ Object

Alias for where.



20
21
22
# File 'lib/sequel/model/dataset_module.rb', line 20

def subset(name, *args, &block)
  where(name, *args, &block)
end