class Torque::PostgreSQL::Reflection::BelongsToManyReflection

Public Instance Methods

active_record_primary_key() click to toggle source
# File lib/torque/postgresql/reflection/belongs_to_many_reflection.rb, line 35
def active_record_primary_key
  @active_record_primary_key ||= options[:primary_key] || derive_primary_key
end
association_class() click to toggle source
# File lib/torque/postgresql/reflection/belongs_to_many_reflection.rb, line 23
def association_class
  Associations::BelongsToManyAssociation
end
association_foreign_key() click to toggle source
# File lib/torque/postgresql/reflection/belongs_to_many_reflection.rb, line 31
def association_foreign_key
  @association_foreign_key ||= foreign_key
end
belongs_to?() click to toggle source
# File lib/torque/postgresql/reflection/belongs_to_many_reflection.rb, line 15
def belongs_to?
  true
end
collection?() click to toggle source
# File lib/torque/postgresql/reflection/belongs_to_many_reflection.rb, line 19
def collection?
  true
end
connected_through_array?() click to toggle source
# File lib/torque/postgresql/reflection/belongs_to_many_reflection.rb, line 11
def connected_through_array?
  true
end
foreign_key() click to toggle source
# File lib/torque/postgresql/reflection/belongs_to_many_reflection.rb, line 27
def foreign_key
  @foreign_key ||= options[:foreign_key] || derive_foreign_key.freeze
end
join_foreign_key() click to toggle source
# File lib/torque/postgresql/reflection/belongs_to_many_reflection.rb, line 43
def join_foreign_key
  foreign_key
end
join_primary_key(*) click to toggle source
# File lib/torque/postgresql/reflection/belongs_to_many_reflection.rb, line 39
def join_primary_key(*)
  active_record_primary_key
end
macro() click to toggle source
# File lib/torque/postgresql/reflection/belongs_to_many_reflection.rb, line 7
def macro
  :belongs_to_many
end

Private Instance Methods

derive_foreign_key() click to toggle source
# File lib/torque/postgresql/reflection/belongs_to_many_reflection.rb, line 53
def derive_foreign_key
  "#{name.to_s.singularize}_ids"
end
derive_primary_key() click to toggle source
# File lib/torque/postgresql/reflection/belongs_to_many_reflection.rb, line 49
def derive_primary_key
  klass.primary_key
end