Method: Sequel::Model::Associations::ManyToOneAssociationReflection#can_have_associated_objects?
- Defined in:
- lib/sequel/model/associations.rb
#can_have_associated_objects?(obj) ⇒ Boolean
many_to_one associations can only have associated objects if none of the :keys options have a nil value.
861 862 863 |
# File 'lib/sequel/model/associations.rb', line 861 def can_have_associated_objects?(obj) !self[:keys].any?{|k| obj.get_column_value(k).nil?} end |