aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLee Bankewitz <lee@weplay.com>2009-08-10 14:51:54 -0400
committerLee Bankewitz <lee@weplay.com>2009-08-10 15:58:54 -0400
commit724b48620c5cf21920717d66eea6e7cd4148b535 (patch)
treeb936ecb0a42eb1d169c404c9d0cac6258906bca1 /lib
parent019f35a266c8e27e6dcf443b3c4d92648b96ce89 (diff)
downloadrails-724b48620c5cf21920717d66eea6e7cd4148b535.tar.gz
rails-724b48620c5cf21920717d66eea6e7cd4148b535.tar.bz2
rails-724b48620c5cf21920717d66eea6e7cd4148b535.zip
Bug fix: Don't use #delegate to declare delegations when intentionally delegating to nil
This accounts for a behavior change after Rails 2.3
Diffstat (limited to 'lib')
-rw-r--r--lib/arel/engines/sql/primitives.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/arel/engines/sql/primitives.rb b/lib/arel/engines/sql/primitives.rb
index bb3bed78e6..16e1abdf59 100644
--- a/lib/arel/engines/sql/primitives.rb
+++ b/lib/arel/engines/sql/primitives.rb
@@ -3,7 +3,7 @@ module Arel
def relation
nil
end
-
+
def to_sql(formatter = nil)
self
end
@@ -28,7 +28,13 @@ module Arel
end
class Value
- delegate :inclusion_predicate_sql, :equality_predicate_sql, :to => :value
+ def inclusion_predicate_sql
+ value.inclusion_predicate_sql
+ end
+
+ def equality_predicate_sql
+ value.equality_predicate_sql
+ end
def to_sql(formatter = Sql::WhereCondition.new(relation))
formatter.value value