diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-20 14:36:04 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-20 14:36:04 -0700 |
commit | e12513659d2b145c216ddb755950705eb2efcb3c (patch) | |
tree | 5f3f545f3abb1332d0f1e4ef42e9c1967f273710 /lib/arel/visitors | |
parent | b95deec5c77f92083b456469d22ca7a4b6880827 (diff) | |
download | rails-e12513659d2b145c216ddb755950705eb2efcb3c.tar.gz rails-e12513659d2b145c216ddb755950705eb2efcb3c.tar.bz2 rails-e12513659d2b145c216ddb755950705eb2efcb3c.zip |
using aliases for terminal nodes
Diffstat (limited to 'lib/arel/visitors')
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index 9186d28566..cbe2b6cca3 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -210,17 +210,18 @@ module Arel alias :visit_Arel_Nodes_SqlLiteral :visit_Fixnum alias :visit_Arel_SqlLiteral :visit_Fixnum # This is deprecated - def visit_TrueClass o; quote(o) end def visit_String o; quote(o) end - def visit_Hash o; quote(o) end - def visit_ActiveSupport_Multibyte_Chars o; quote(o) end - def visit_Symbol o; quote(o) end - def visit_Time o; quote(o) end - def visit_Date o; quote(o) end - def visit_DateTime o; quote(o) end - def visit_Float o; quote(o) end - def visit_BigDecimal o; quote(o) end - def visit_FalseClass o; quote(o) end + + alias :visit_ActiveSupport_Multibyte_Chars :visit_String + alias :visit_BigDecimal :visit_String + alias :visit_Date :visit_String + alias :visit_DateTime :visit_String + alias :visit_FalseClass :visit_String + alias :visit_Float :visit_String + alias :visit_Hash :visit_String + alias :visit_Symbol :visit_String + alias :visit_Time :visit_String + alias :visit_TrueClass :visit_String DISPATCH = Hash.new do |hash, klass| hash[klass] = "visit_#{klass.name.gsub('::', '_')}" |