diff options
author | Daniel Morrison <daniel@collectiveidea.com> | 2008-06-15 16:25:59 -0400 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-22 20:33:43 -0700 |
commit | 3610997ba32128921115bedb89c322a7bcbe161a (patch) | |
tree | 00ea6993b4c2981bf64a371f26a1d4bcaed7e3be /activerecord/lib/active_record | |
parent | 0fd3e4cd2b2b1b31304a922dc65284d5363f78b6 (diff) | |
download | rails-3610997ba32128921115bedb89c322a7bcbe161a.tar.gz rails-3610997ba32128921115bedb89c322a7bcbe161a.tar.bz2 rails-3610997ba32128921115bedb89c322a7bcbe161a.zip |
Partial updates don't update lock_version if nothing changed. [#426 state:resolved]
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/locking/optimistic.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/locking/optimistic.rb b/activerecord/lib/active_record/locking/optimistic.rb index c66034d18b..ff9899d032 100644 --- a/activerecord/lib/active_record/locking/optimistic.rb +++ b/activerecord/lib/active_record/locking/optimistic.rb @@ -68,6 +68,7 @@ module ActiveRecord def update_with_lock(attribute_names = @attributes.keys) #:nodoc: return update_without_lock(attribute_names) unless locking_enabled? + return 0 if attribute_names.empty? lock_col = self.class.locking_column previous_value = send(lock_col).to_i |