Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Denied the quoting of SqlLiterals

  • Loading branch information...
commit 9c514f39bd040c45ffa7df43bab24c2a0c88c6e3 1 parent 38d0a22
@olliwer olliwer authored
Showing with 9 additions and 0 deletions.
  1. +1 −0  lib/arel/visitors/to_sql.rb
  2. +8 −0 test/test_update_manager.rb
View
1  lib/arel/visitors/to_sql.rb
@@ -589,6 +589,7 @@ def visit_Array o
end
def quote value, column = nil
+ return value if Arel::Nodes::SqlLiteral === value
@connection.quote value, column
end
View
8 test/test_update_manager.rb
@@ -8,6 +8,14 @@ module Arel
end
end
+ it "should not quote sql literals" do
+ table = Table.new(:users)
+ um = Arel::UpdateManager.new Table.engine
+ um.table table
+ um.set [[table[:name], (Arel::Nodes::BindParam.new '?')]]
+ um.to_sql.must_be_like %{ UPDATE "users" SET "name" = ? }
+ end
+
it 'handles limit properly' do
table = Table.new(:users)
um = Arel::UpdateManager.new Table.engine
Please sign in to comment.
Something went wrong with that request. Please try again.