diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-04-29 19:38:39 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-04-29 19:38:39 -0300 |
commit | b4b73d9520a2ff27021b530ccd3dcd96973ce5fe (patch) | |
tree | 5a72648ea38f5ca0d739119d54617596d3e2b139 /lib/arel/primitives/value.rb | |
parent | 5e4bfb1ce4144785feaeffc6210740e3e4ce5770 (diff) | |
download | rails-b4b73d9520a2ff27021b530ccd3dcd96973ce5fe.tar.gz rails-b4b73d9520a2ff27021b530ccd3dcd96973ce5fe.tar.bz2 rails-b4b73d9520a2ff27021b530ccd3dcd96973ce5fe.zip |
Added DISTINCT support. Modified when to quote or not columns and tables.
Diffstat (limited to 'lib/arel/primitives/value.rb')
-rw-r--r-- | lib/arel/primitives/value.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/arel/primitives/value.rb b/lib/arel/primitives/value.rb index 36a7fb7c71..9c6e518a95 100644 --- a/lib/arel/primitives/value.rb +++ b/lib/arel/primitives/value.rb @@ -6,7 +6,11 @@ module Arel def to_sql(formatter = Sql::WhereCondition.new(relation)) - formatter.value value + if value =~ /^\(.*\)$/ + value + else + formatter.value value + end end def format(object) |