Sha256: 2068a9fa6c1a3220088dc222bcd7312edd3b6b8412602b082a91e2a35352ded5

Contents?: true

Size: 294 Bytes

Versions: 34

Compression:

Stored size: 294 Bytes

Contents

# frozen_string_literal: true

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

Version data entries

34 entries across 34 versions & 4 rubygems

Version Path
activerecord-5.2.8.1 lib/active_record/associations/foreign_association.rb
activerecord-5.2.8 lib/active_record/associations/foreign_association.rb
activerecord-5.2.7.1 lib/active_record/associations/foreign_association.rb
activerecord-5.2.7 lib/active_record/associations/foreign_association.rb
activerecord-5.2.6.3 lib/active_record/associations/foreign_association.rb
activerecord-5.2.6.2 lib/active_record/associations/foreign_association.rb
activerecord-5.2.6.1 lib/active_record/associations/foreign_association.rb
activerecord-5.2.6 lib/active_record/associations/foreign_association.rb
activerecord-5.2.4.6 lib/active_record/associations/foreign_association.rb
activerecord-5.2.5 lib/active_record/associations/foreign_association.rb
activerecord-5.2.4.5 lib/active_record/associations/foreign_association.rb
activerecord-5.2.4.4 lib/active_record/associations/foreign_association.rb
activerecord-5.2.4.3 lib/active_record/associations/foreign_association.rb
activerecord-5.2.4.2 lib/active_record/associations/foreign_association.rb
activerecord-5.2.4.1 lib/active_record/associations/foreign_association.rb
activerecord-5.2.4 lib/active_record/associations/foreign_association.rb
activerecord-5.2.4.rc1 lib/active_record/associations/foreign_association.rb
spiral_form-0.1.1 vendor/bundle/gems/activerecord-5.2.3/lib/active_record/associations/foreign_association.rb
spiral_form-0.1.0 vendor/bundle/gems/activerecord-5.2.3/lib/active_record/associations/foreign_association.rb
activerecord-5.2.3 lib/active_record/associations/foreign_association.rb