diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-09 17:02:32 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-09 17:02:32 +0000 |
commit | c20713834a6f3e14286fb501029437708609eaff (patch) | |
tree | 5ff7ae6b493d73a9eac9e522c54ba1cf750f910a /activerecord/lib/active_record/connection_adapters | |
parent | 165f82d18026dbbcf94695128d32fadef916af5a (diff) | |
download | rails-c20713834a6f3e14286fb501029437708609eaff.tar.gz rails-c20713834a6f3e14286fb501029437708609eaff.tar.bz2 rails-c20713834a6f3e14286fb501029437708609eaff.zip |
Fixed optimistic locking with SQL Server #1660 [tom@popdog.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1784 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
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 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"] |