提交 6f9f83e4 编写于 作者: A Aaron Patterson

if FROM is a string, convert to string literal

上级 dfa520b9
...@@ -51,6 +51,7 @@ def group *columns ...@@ -51,6 +51,7 @@ def group *columns
end end
def from table def from table
table = Nodes::SqlLiteral.new(table) if String === table
@ctx.froms = [table] @ctx.froms = [table]
self self
end end
......
...@@ -60,7 +60,7 @@ def execute sql, name = nil ...@@ -60,7 +60,7 @@ def execute sql, name = nil
manager.from table manager.from table
manager.from 'users' manager.from 'users'
manager.project table['id'] manager.project table['id']
manager.to_sql.should be_like 'SELECT "users"."id" FROM \'users\'' manager.to_sql.should be_like 'SELECT "users"."id" FROM users'
end end
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册