diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-01-13 18:31:35 -0800 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-01-13 18:31:35 -0800 |
commit | bc4f6b8a29fc96c05efe0304ce7fad075818d2a2 (patch) | |
tree | 75f1b67bddf5ce5e247f57c5f9d8f8bde05c1f51 /lib/active_relation/extensions/object.rb | |
parent | 2e63ac91302e2df397a286fdaf9cea51635071a6 (diff) | |
download | rails-bc4f6b8a29fc96c05efe0304ce7fad075818d2a2.tar.gz rails-bc4f6b8a29fc96c05efe0304ce7fad075818d2a2.tar.bz2 rails-bc4f6b8a29fc96c05efe0304ce7fad075818d2a2.zip |
experimenting with strategy pattern rather than conditional; not as terse, nor transparent, but i still feel it's better
Diffstat (limited to 'lib/active_relation/extensions/object.rb')
-rw-r--r-- | lib/active_relation/extensions/object.rb | 7 |
1 files changed, 2 insertions, 5 deletions
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 |