aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/foreign_association.rb
blob: 3ceec0ee46885a38306e888f8cb050ec1a6b4211 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
module ActiveRecord::Associations
  module ForeignAssociation # :nodoc:
    def foreign_key_present?
      if reflection.klass.primary_key
        owner.attribute_present?(reflection.active_record_primary_key)
      else
        false
      end
    end
  end
end