Module | Sequel::Plugins::ManyThroughMany::ClassMethods |
In: |
lib/sequel/plugins/many_through_many.rb
|
Create a many_through_many association. Arguments:
name : | Same as associate, the name of the association. | ||||||||||||||
through : | The tables and keys to join between the current table and the associated
table. Must be an array, with elements that are either 3 element arrays, or
hashes with keys :table, :left, and :right. The required entries in the
array/hash are:
If a hash is provided, the following keys are respected when using eager_graph:
| ||||||||||||||
opts : | The options for the associaion. Takes the same options as many_to_many. |
# File lib/sequel/plugins/many_through_many.rb, line 217 217: def many_through_many(name, through, opts=OPTS, &block) 218: associate(:many_through_many, name, opts.merge(through.is_a?(Hash) ? through : {:through=>through}), &block) 219: end
Creates a one_through_many association. See many_through_many for arguments.
# File lib/sequel/plugins/many_through_many.rb, line 222 222: def one_through_many(name, through, opts=OPTS, &block) 223: associate(:one_through_many, name, opts.merge(through.is_a?(Hash) ? through : {:through=>through}), &block) 224: end