Method: Sequel::Model::Associations::ManyToManyAssociationReflection#associated_key_array

Defined in:
lib/sequel/model/associations.rb

#associated_key_arrayObject

Array of associated keys used when eagerly loading.



1246
1247
1248
1249
1250
1251
1252
1253
1254
# File 'lib/sequel/model/associations.rb', line 1246

def associated_key_array
  cached_fetch(:associated_key_array) do
    if self[:uses_left_composite_keys]
      associated_key_alias.zip(predicate_keys).map{|a, k| SQL::AliasedExpression.new(k, a)}
    else
      [SQL::AliasedExpression.new(predicate_key, associated_key_alias)]
    end
  end
end