Method: Sequel::Model::ClassMethods#dataset
- Defined in:
- lib/sequel/model/base.rb
#dataset ⇒ Object
Returns the dataset associated with the Model class. Raises an Error if there is no associated dataset for this class. In most cases, you don’t need to call this directly, as Model proxies many dataset methods to the underlying dataset.
Artist.dataset.all # SELECT * FROM artists
269 270 271 |
# File 'lib/sequel/model/base.rb', line 269 def dataset @dataset || raise(Error, "No dataset associated with #{self}") end |