Class: DataMapper::Query::Conditions::GreaterThanOrEqualToComparison

Inherits:
AbstractComparison show all
Defined in:
lib/dm-core/query/conditions/comparison.rb

Overview

Tests whether the value in the record is greater than, or equal to, the expected set for the Comparison.

Instance Attribute Summary

Attributes inherited from AbstractComparison

#loaded_value, #parent, #subject

Instance Method Summary collapse

Methods inherited from AbstractComparison

descendants, inherited, #inspect, #negated?, #property?, #relationship?, slug, #slug, #to_s, #valid?, #value

Methods included from Equalizer

#equalize

Instance Method Details

#matches?(record) ⇒ Boolean

Tests that the record value matches the comparison

Parameters:

  • record (Resource, Hash)

    The record containing the value to be matched

Returns:

  • (Boolean)


861
862
863
864
865
# File 'lib/dm-core/query/conditions/comparison.rb', line 861

def matches?(record)
  return false if expected.nil?
  record_value = record_value(record)
  !record_value.nil? && record_value >= expected
end