diff options
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb index a1b424f260..de40780a5a 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb @@ -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 |