diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-16 15:46:53 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-16 15:46:53 -0700 |
commit | 1aa48994b2d6a317c2692bde873b517877bba80e (patch) | |
tree | daee5146f3345cc5668fa31946425e953d4d7631 /lib/arel/visitors | |
parent | f47d083c5bbbac1a807954a20a35888024fb4707 (diff) | |
download | rails-1aa48994b2d6a317c2692bde873b517877bba80e.tar.gz rails-1aa48994b2d6a317c2692bde873b517877bba80e.tar.bz2 rails-1aa48994b2d6a317c2692bde873b517877bba80e.zip |
sql visitor can deal with TrueClass
Diffstat (limited to 'lib/arel/visitors')
-rw-r--r-- | lib/arel/visitors/dot.rb | 8 | ||||
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/arel/visitors/dot.rb b/lib/arel/visitors/dot.rb index 4b37927685..8a03819768 100644 --- a/lib/arel/visitors/dot.rb +++ b/lib/arel/visitors/dot.rb @@ -28,6 +28,12 @@ module Arel end private + def visit_Arel_Nodes_InsertStatement o + visit_edge o, "relation" + visit_edge o, "columns" + visit_edge o, "values" + end + def visit_Arel_Nodes_SelectCore o visit_edge o, "froms" visit_edge o, "projections" @@ -50,12 +56,14 @@ module Arel alias :visit_Arel_Attributes_Integer :visit_Arel_Attribute alias :visit_Arel_Attributes_String :visit_Arel_Attribute alias :visit_Arel_Attributes_Time :visit_Arel_Attribute + alias :visit_Arel_Attributes_Boolean :visit_Arel_Attribute def visit_String o @node_stack.last.fields << o end alias :visit_Time :visit_String alias :visit_NilClass :visit_String + alias :visit_TrueClass :visit_String alias :visit_Arel_SqlLiteral :visit_String alias :visit_Fixnum :visit_String diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index bb93876595..b0fed4936b 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -74,6 +74,7 @@ module Arel def visit_Fixnum o; o end alias :visit_Time :visit_Fixnum alias :visit_String :visit_Fixnum + alias :visit_TrueClass :visit_Fixnum alias :visit_Arel_Nodes_SqlLiteral :visit_Fixnum alias :visit_Arel_SqlLiteral :visit_Fixnum # This is deprecated |