module Sequel::Plugins::DatasetAssociations::ClassMethods

Public Instance Methods

associate(type, name, *) click to toggle source

Set up a dataset method for each association to return an associated dataset

Calls superclass method
# File lib/sequel/plugins/dataset_associations.rb, line 61
def associate(type, name, *)
  ret = super
  r = association_reflection(name)
  meth = r.returns_array? ? name : pluralize(name).to_sym
  def_dataset_method(meth){associated(name)}
  ret
end