lib/sequel/plugins/many_through_many.rb in sequel-3.16.0 vs lib/sequel/plugins/many_through_many.rb in sequel-3.17.0
- old
+ new
@@ -139,11 +139,11 @@
# * :right_primary_key - column in associated table that the final :right option in
# through points to, as a symbol. Defaults to primary key of the associated table. Can use an
# array of symbols for a composite key association.
# * :uniq - Adds a after_load callback that makes the array of objects unique.
def many_through_many(name, through, opts={}, &block)
- associate(:many_through_many, name, opts.merge(:through=>through), &block)
- end
+ associate(:many_through_many, name, opts.merge(through.is_a?(Hash) ? through : {:through=>through}), &block)
+ end
private
# Create the association methods and :eager_loader and :eager_grapher procs.
def def_many_through_many(opts)