Class: ActiveRecord::Associations::Preloader::BelongsTo
- Inherits:
-
SingularAssociation
- Object
- Association
- SingularAssociation
- ActiveRecord::Associations::Preloader::BelongsTo
- Defined in:
- activerecord/lib/active_record/associations/preloader/belongs_to.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from Association
Instance Method Summary collapse
Methods inherited from SingularAssociation
#build, #create, #create!, #reader, #writer
Methods inherited from Association
#aliased_table_name, #association_scope, #initialize, #interpolate, #klass, #load_target, #loaded!, #loaded?, #reload, #reset, #reset_scope, #scoped, #set_inverse_instance, #stale_target?, #target_scope
Constructor Details
This class inherits a constructor from ActiveRecord::Associations::Association
Instance Method Details
#association_key_name ⇒ Object
6 7 8 |
# File 'activerecord/lib/active_record/associations/preloader/belongs_to.rb', line 6 def association_key_name reflection.[:primary_key] || klass && klass.primary_key end |
#owner_key_name ⇒ Object
10 11 12 |
# File 'activerecord/lib/active_record/associations/preloader/belongs_to.rb', line 10 def owner_key_name reflection.foreign_key end |