From bc4f6b8a29fc96c05efe0304ce7fad075818d2a2 Mon Sep 17 00:00:00 2001 From: Nick Kallen Date: Sun, 13 Jan 2008 18:31:35 -0800 Subject: experimenting with strategy pattern rather than conditional; not as terse, nor transparent, but i still feel it's better --- lib/active_relation/extensions/object.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/active_relation/extensions/object.rb') diff --git a/lib/active_relation/extensions/object.rb b/lib/active_relation/extensions/object.rb index ea582d1ca1..2d43120f70 100644 --- a/lib/active_relation/extensions/object.rb +++ b/lib/active_relation/extensions/object.rb @@ -1,12 +1,9 @@ class Object - include ActiveRelation::SqlBuilder - def qualify self end - def to_sql(options = {}) - options.reverse_merge!(:quote => true) - options[:quote] ? quote(self) : self + def to_sql(strategy = ActiveRelation::Sql::Scalar.new) + strategy.scalar self end end \ No newline at end of file -- cgit v1.2.3