Class: DataMapper::Query::Conditions::InclusionComparison
- Inherits:
-
AbstractComparison
- Object
- AbstractComparison
- DataMapper::Query::Conditions::InclusionComparison
- Includes:
- RelationshipHandler
- Defined in:
- lib/dm-core/query/conditions/comparison.rb
Overview
Tests whether the value in the record is contained in the expected set for the Comparison, where expected is an Array, Range, or Set.
Instance Attribute Summary
Attributes inherited from AbstractComparison
#dumped_value, #loaded_value, #parent, #subject
Instance Method Summary collapse
-
#valid? ⇒ Boolean
Checks that the Comparison is valid.
Methods included from RelationshipHandler
#foreign_key_mapping, #matches?, #relationship?
Methods inherited from AbstractComparison
descendants, inherited, #inspect, #matches?, #negated?, #property?, #relationship?, slug, #slug, #to_s, #value
Methods included from Equalizer
Instance Method Details
#valid? ⇒ Boolean
Checks that the Comparison is valid
570 571 572 573 574 575 576 577 578 579 |
# File 'lib/dm-core/query/conditions/comparison.rb', line 570 def valid? loaded_value = self.loaded_value case loaded_value when Collection then valid_collection?(loaded_value) when Range then valid_range?(loaded_value) when Enumerable then valid_enumerable?(loaded_value) else false end end |