From 89eff9708d9519f8a2724427d9ed9a3bcbc6d125 Mon Sep 17 00:00:00 2001 From: Nick Kallen Date: Fri, 11 Apr 2008 14:40:33 -0700 Subject: removed binding for attributes and predicates --- lib/active_relation/predicates.rb | 2 +- lib/active_relation/primitives/attribute.rb | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/active_relation/predicates.rb b/lib/active_relation/predicates.rb index e17a9f82fe..dc4610b052 100644 --- a/lib/active_relation/predicates.rb +++ b/lib/active_relation/predicates.rb @@ -25,7 +25,7 @@ module ActiveRelation end def to_sql(formatter = nil) - "#{operand2.format(operand1)} #{predicate_sql} #{operand1.format(operand2)}" + "#{operand1.to_sql} #{predicate_sql} #{operand1.format(operand2)}" end def descend diff --git a/lib/active_relation/primitives/attribute.rb b/lib/active_relation/primitives/attribute.rb index d78e940ffc..ddf5ef5e07 100644 --- a/lib/active_relation/primitives/attribute.rb +++ b/lib/active_relation/primitives/attribute.rb @@ -63,31 +63,31 @@ module ActiveRelation module Predications def eq(other) - Equality.new(self, other.bind(relation)) + Equality.new(self, other) end def lt(other) - LessThan.new(self, other.bind(relation)) + LessThan.new(self, other) end def lteq(other) - LessThanOrEqualTo.new(self, other.bind(relation)) + LessThanOrEqualTo.new(self, other) end def gt(other) - GreaterThan.new(self, other.bind(relation)) + GreaterThan.new(self, other) end def gteq(other) - GreaterThanOrEqualTo.new(self, other.bind(relation)) + GreaterThanOrEqualTo.new(self, other) end def matches(regexp) - Match.new(self, regexp.bind(relation)) + Match.new(self, regexp) end def in(array) - In.new(self, array.bind(relation)) + In.new(self, array) end end include Predications -- cgit v1.2.3