123456789_123456789_123456789_123456789_123456789_

Module: ActiveRecord::Associations::ForeignAssociation

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
ActiveRecord::Associations::HasManyAssociation, ActiveRecord::Associations::HasManyThroughAssociation, ActiveRecord::Associations::HasOneAssociation, ActiveRecord::Associations::HasOneThroughAssociation
Defined in: activerecord/lib/active_record/associations/foreign_association.rb

Instance Attribute Summary

Instance Attribute Details

#foreign_key_present?Boolean (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/associations/foreign_association.rb', line 3

def foreign_key_present?
  if reflection.klass.primary_key
    owner.attribute_present?(reflection.active_record_primary_key)
  else
    false
  end
end