Sha256: e5779196c5d0f02930300c5d967dd1f10693c3689db31b3b642f2be2d73a5c4c
Contents?: true
Size: 487 Bytes
Versions: 39
Compression:
Stored size: 487 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 def nullified_owner_attributes Hash.new.tap do |attrs| attrs[reflection.foreign_key] = nil attrs[reflection.type] = nil if reflection.type.present? end end end end
Version data entries
39 entries across 39 versions & 4 rubygems