Class: Dynamoid::Criteria::OverwrittenConditionsDetector

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamoid/criteria/overwritten_conditions_detector.rb

Instance Method Summary collapse

Constructor Details

#initialize(conditions, conditions_new) ⇒ OverwrittenConditionsDetector

Returns a new instance of OverwrittenConditionsDetector.


7
8
9
10
11
# File 'lib/dynamoid/criteria/overwritten_conditions_detector.rb', line 7

def initialize(conditions, conditions_new)
  @conditions = conditions
  @new_conditions = conditions_new
  @overwritten_keys = overwritten_keys
end

Instance Method Details

#found?Boolean

Returns:

  • (Boolean)

13
14
15
# File 'lib/dynamoid/criteria/overwritten_conditions_detector.rb', line 13

def found?
  @overwritten_keys.present?
end

#warning_messageObject


17
18
19
20
21
22
# File 'lib/dynamoid/criteria/overwritten_conditions_detector.rb', line 17

def warning_message
  return unless found?

  'Where conditions may contain only one condition for an attribute. ' \
    "Following conditions are ignored: #{ignored_conditions}"
end