diff options
Diffstat (limited to 'activerecord/lib/active_record')
-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 1863a9be57..7b68283e57 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb @@ -236,9 +236,9 @@ module ActiveRecord end def execute(sql, name = nil) - if sql =~ /^INSERT/i + if sql =~ /^\s*INSERT/i insert(sql, name) - elsif sql =~ /^UPDATE|DELETE/i + elsif sql =~ /^\s*UPDATE|^\s*DELETE/i log(sql, name) do @connection.execute(sql) retVal = select_one("SELECT @@ROWCOUNT AS AffectedRows")["AffectedRows"] |