aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-03-21 21:35:23 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-03-21 21:35:23 -0700
commitb707dddd89a61b86570cbe3a5e923bb8e436c38d (patch)
tree62eb89e45a3667e5bfbd21efaea59af6fff9e7c8 /lib
parent4dade480a1d19b1343de8c68b94f74a1237c396a (diff)
downloadrails-b707dddd89a61b86570cbe3a5e923bb8e436c38d.tar.gz
rails-b707dddd89a61b86570cbe3a5e923bb8e436c38d.tar.bz2
rails-b707dddd89a61b86570cbe3a5e923bb8e436c38d.zip
allowing sql literals for values in insert statements
Diffstat (limited to 'lib')
-rw-r--r--lib/arel/visitors/to_sql.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb
index 1c91d7f5e6..bbb2c54655 100644
--- a/lib/arel/visitors/to_sql.rb
+++ b/lib/arel/visitors/to_sql.rb
@@ -102,7 +102,11 @@ key on UpdateManager using UpdateManager#key=
def visit_Arel_Nodes_Values o
"VALUES (#{o.expressions.zip(o.columns).map { |value, attr|
- quote(value, attr && column_for(attr))
+ if Nodes::SqlLiteral === value
+ visit_Arel_Nodes_SqlLiteral value
+ else
+ quote(value, attr && column_for(attr))
+ end
}.join ', '})"
end