Module: ActiveRecord::Associations::ForeignAssociation
- Defined in:
- lib/composite_primary_keys/associations/foreign_association.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#foreign_key_present? ⇒ Boolean
5 6 7 8 9 10 11 12 13 |
# File 'lib/composite_primary_keys/associations/foreign_association.rb', line 5 def foreign_key_present? if reflection.klass.primary_key # CPK # owner.attribute_present?(reflection.active_record_primary_key) Array(reflection.active_record_primary_key).all? {|key| owner.attribute_present?(key)} else false end end |