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