lib/sequel/plugins/many_through_many.rb in sequel-3.12.1 vs lib/sequel/plugins/many_through_many.rb in sequel-3.13.0
- old
+ new
@@ -1,8 +1,8 @@
module Sequel
module Plugins
- # The many_through_many plugin allow you to create a association to multiple objects using multiple join tables.
+ # The many_through_many plugin allow you to create an association to multiple objects using multiple join tables.
# For example, assume the following associations:
#
# Artist.many_to_many :albums
# Album.many_to_many :tags
#
@@ -183,10 +183,10 @@
h = eo[:key_hash][left_pk]
eo[:rows].each{|object| object.associations[name] = []}
ds = opts.associated_class
opts.reverse_edges.each{|t| ds = ds.join(t[:table], Array(t[:left]).zip(Array(t[:right])), :table_alias=>t[:alias])}
ft = opts[:final_reverse_edge]
- conds = uses_lcks ? [[left_keys.map{|k| SQL::QualifiedIdentifier.new(ft[:table], k)}, SQL::SQLArray.new(h.keys)]] : [[left_key, h.keys]]
+ conds = uses_lcks ? [[left_keys.map{|k| SQL::QualifiedIdentifier.new(ft[:table], k)}, h.keys]] : [[left_key, h.keys]]
ds = ds.join(ft[:table], Array(ft[:left]).zip(Array(ft[:right])) + conds, :table_alias=>ft[:alias])
model.eager_loading_dataset(opts, ds, Array(opts.select), eo[:associations], eo).all do |assoc_record|
hash_key = if uses_lcks
left_key_alias.map{|k| assoc_record.values.delete(k)}
else