Class: ActiveRecord::Associations::Preloader::BelongsTo

Inherits:
SingularAssociation show all
Defined in:
activerecord/lib/active_record/associations/preloader/belongs_to.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Association

#klass, #model, #owners, #preload_scope, #preloaded_records, #reflection

Instance Method Summary collapse

Methods inherited from Association

#initialize, #preload, #run

Constructor Details

This class inherits a constructor from ActiveRecord::Associations::Preloader::Association

Instance Method Details

#association_key_nameObject



7
8
9
# File 'activerecord/lib/active_record/associations/preloader/belongs_to.rb', line 7

def association_key_name
  options[:primary_key] || klass && klass.primary_key
end

#owner_key_nameObject



11
12
13
# File 'activerecord/lib/active_record/associations/preloader/belongs_to.rb', line 11

def owner_key_name
  reflection.foreign_key
end