diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-03-16 17:27:40 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-03-16 17:27:40 -0700 |
commit | 7bd0d634867ccbdf4537ba3d62b865b1cb7beebf (patch) | |
tree | f469465c385a99722b2263cae5f68a1a961a3c76 /lib/active_relation/sql.rb | |
parent | aa5c9a19826c84bbb9c9f75f8d1a4b04b874780c (diff) | |
download | rails-7bd0d634867ccbdf4537ba3d62b865b1cb7beebf.tar.gz rails-7bd0d634867ccbdf4537ba3d62b865b1cb7beebf.tar.bz2 rails-7bd0d634867ccbdf4537ba3d62b865b1cb7beebf.zip |
allowing string passthrough for order clauses
Diffstat (limited to 'lib/active_relation/sql.rb')
-rw-r--r-- | lib/active_relation/sql.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/active_relation/sql.rb b/lib/active_relation/sql.rb index 027356d4d7..3a773fdf6e 100644 --- a/lib/active_relation/sql.rb +++ b/lib/active_relation/sql.rb @@ -24,12 +24,21 @@ module ActiveRelation end end - class WhereClause < Formatter + class PassThrough < Formatter def value(value) value end end + class WhereClause < PassThrough + end + + class OrderClause < PassThrough + def attribute(relation_name, attribute_name, aliaz) + "#{quote_table_name(relation_name)}.#{quote_column_name(attribute_name)}" + end + end + class WhereCondition < Formatter def attribute(relation_name, attribute_name, aliaz) "#{quote_table_name(relation_name)}.#{quote_column_name(attribute_name)}" |