1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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
This commit is contained in:
David Heinemeier Hansson 2005-11-07 09:54:28 +00:00
parent ea5bd8e756
commit 5132170c72
2 changed files with 4 additions and 2 deletions

View file

@ -1,5 +1,7 @@
*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 ]

View file

@ -447,9 +447,9 @@ module ActiveRecord
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