aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_relation/sql.rb
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-03-16 17:27:40 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-03-16 17:27:40 -0700
commit7bd0d634867ccbdf4537ba3d62b865b1cb7beebf (patch)
treef469465c385a99722b2263cae5f68a1a961a3c76 /lib/active_relation/sql.rb
parentaa5c9a19826c84bbb9c9f75f8d1a4b04b874780c (diff)
downloadrails-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.rb11
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)}"