123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::PredicateBuilder::ComparisonValue

Do not use. This class is for internal use only.

Class Method Summary

Instance Attribute Summary

Instance Method Summary

::Arel::Math - Included

#&, #*, #+, #-, #/, #<<, #>>, #^, #|, #~@

::Arel::OrderPredications - Included

::Arel::AliasPredication - Included

#as

::Arel::Predications - Included

::Arel::Expressions - Included

::Arel::Nodes::Node - Inherited

#and

Factory method to create an Nodes::And node.

#fetch_attribute, #invert,
#not

Factory method to create a Nodes::Not node that has the recipient of the caller as a child.

#or

Factory method to create a Nodes::Grouping node that has an Nodes::Or node as a child.

#to_sql

FIXME: this method should go away.

::Arel::FactoryMethods - Included

Constructor Details

.new(query_attribute) ⇒ ComparisonValue

[ GitHub ]

  
# File 'activerecord/lib/active_record/relation/predicate_builder/comparison.rb', line 43

def initialize(query_attribute)
  @query_attribute = query_attribute
  @expression = query_attribute.type.comparison_expression(query_attribute)
end

Instance Attribute Details

#expression (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/relation/predicate_builder/comparison.rb', line 41

attr_reader :expression, :query_attribute

#query_attribute (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/relation/predicate_builder/comparison.rb', line 41

attr_reader :expression, :query_attribute

#value_before_type_cast (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/relation/predicate_builder/comparison.rb', line 48

delegate :infinite?, :nil?, :unboundable?, :value_before_type_cast, to: :query_attribute

Instance Method Details

#==(other) Also known as: #eql?

[ GitHub ]

  
# File 'activerecord/lib/active_record/relation/predicate_builder/comparison.rb', line 54

def ==(other)
  self.class == other.class &&
    expression == other.expression &&
    query_attribute == other.query_attribute
end

#eql?(other)

Alias for #==.

[ GitHub ]

  
# File 'activerecord/lib/active_record/relation/predicate_builder/comparison.rb', line 59

alias eql? ==

#hash

[ GitHub ]

  
# File 'activerecord/lib/active_record/relation/predicate_builder/comparison.rb', line 50

def hash
  [self.class, expression, query_attribute].hash
end

#infinite?Boolean

[ GitHub ]

  
# File 'activerecord/lib/active_record/relation/predicate_builder/comparison.rb', line 48

delegate :infinite?, :nil?, :unboundable?, :value_before_type_cast, to: :query_attribute

#nil?Boolean

[ GitHub ]

  
# File 'activerecord/lib/active_record/relation/predicate_builder/comparison.rb', line 48

delegate :infinite?, :nil?, :unboundable?, :value_before_type_cast, to: :query_attribute

#unboundable?Boolean

[ GitHub ]

  
# File 'activerecord/lib/active_record/relation/predicate_builder/comparison.rb', line 48

delegate :infinite?, :nil?, :unboundable?, :value_before_type_cast, to: :query_attribute