提交 5132170c 编写于 作者: D David Heinemeier Hansson

Fixed faulty regex in get_table_name method (SQLServerAdapter) (closes #2639) [Ryan Tomayko]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2910 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 ea5bd8e7
*SVN*
* Fixed faulty regex in get_table_name method (SQLServerAdapter) #2639 [Ryan Tomayko]
* Added :include as an option for association declarations [DHH]. Example:
has_many :posts, :include => [ :author, :comments ]
......
......@@ -447,9 +447,9 @@ def enable_identity_insert(table_name, enable = true)
end
def get_table_name(sql)
if sql =~ /into\s*([^\(\s]+)\s*|update\s*([^\(\s]+)\s*/i
if sql =~ /^\s*insert\s+into\s+([^\(\s]+)\s*|^\s*update\s+([^\(\s]+)\s*/i
$1
elsif sql =~ /from\s*([^\(\s]+)\s*/i
elsif sql =~ /from\s+([^\(\s]+)\s*/i
$1
else
nil
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册