提交 458ef3fb 编写于 作者: A Aaron Patterson

inserting false works a bit better

上级 77701cb5
......@@ -43,7 +43,7 @@ def visit_Arel_Nodes_InsertStatement o
def visit_Arel_Nodes_Values o
"VALUES (#{o.expressions.map { |value|
value ? visit(value) : 'NULL'
value.nil? ? 'NULL' : visit(value)
}.join ', '})"
end
......
......@@ -9,6 +9,15 @@ module Arel
end
describe 'insert' do
it "inserts false" do
table = Table.new(:users)
manager = Arel::InsertManager.new Table.engine
manager.insert [[table[:id], false]]
manager.to_sql.should be_like %{
INSERT INTO "users" ("id") VALUES ('f')
}
end
it "inserts null" do
table = Table.new(:users)
manager = Arel::InsertManager.new Table.engine
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册