Module | Sequel::Plugins::DatasetAssociations::ClassMethods |
In: |
lib/sequel/plugins/dataset_associations.rb
|
Set up a dataset method for each association to return an associated dataset
# File lib/sequel/plugins/dataset_associations.rb, line 51 51: def associate(type, name, *) 52: ret = super 53: r = association_reflection(name) 54: meth = r.returns_array? ? name : pluralize(name).to_sym 55: def_dataset_method(meth){associated(name)} 56: ret 57: end