Class: Dynamoid::Criteria::NonexistentFieldsDetector
- Inherits:
-
Object
- Object
- Dynamoid::Criteria::NonexistentFieldsDetector
- Defined in:
- lib/dynamoid/criteria/nonexistent_fields_detector.rb
Instance Method Summary collapse
- #found? ⇒ Boolean
-
#initialize(conditions, source) ⇒ NonexistentFieldsDetector
constructor
A new instance of NonexistentFieldsDetector.
- #warning_message ⇒ Object
Constructor Details
#initialize(conditions, source) ⇒ NonexistentFieldsDetector
Returns a new instance of NonexistentFieldsDetector.
7 8 9 10 11 |
# File 'lib/dynamoid/criteria/nonexistent_fields_detector.rb', line 7 def initialize(conditions, source) @conditions = conditions @source = source @nonexistent_fields = nonexistent_fields end |
Instance Method Details
#found? ⇒ Boolean
13 14 15 |
# File 'lib/dynamoid/criteria/nonexistent_fields_detector.rb', line 13 def found? @nonexistent_fields.present? end |
#warning_message ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/dynamoid/criteria/nonexistent_fields_detector.rb', line 17 def return unless found? fields_list = @nonexistent_fields.map { |s| "`#{s}`" }.join(', ') count = @nonexistent_fields.size 'where conditions contain nonexistent ' \ "field #{'name'.pluralize(count)} #{fields_list}" end |