aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/locking
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-09-05 18:54:24 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-09-05 18:54:24 +0000
commit85fbb22f071b96d5a20ac71dc16d4432c08cdcf3 (patch)
tree4b8482edbaf0c2e598735a14b919a40315f1252b /activerecord/lib/active_record/locking
parent9d7e6432b22a11e96ad7a3cab7510fac7b3927d6 (diff)
downloadrails-85fbb22f071b96d5a20ac71dc16d4432c08cdcf3.tar.gz
rails-85fbb22f071b96d5a20ac71dc16d4432c08cdcf3.tar.bz2
rails-85fbb22f071b96d5a20ac71dc16d4432c08cdcf3.zip
Backed out of new_record? to new? transformation as it would screw up existing models that did boolean calls on "new" attributes [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5018 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/locking')
-rw-r--r--activerecord/lib/active_record/locking/pessimistic.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/locking/pessimistic.rb b/activerecord/lib/active_record/locking/pessimistic.rb
index 81146e0688..caad760742 100644
--- a/activerecord/lib/active_record/locking/pessimistic.rb
+++ b/activerecord/lib/active_record/locking/pessimistic.rb
@@ -69,7 +69,7 @@ module ActiveRecord
# or pass true for "FOR UPDATE" (the default, an exclusive row lock). Returns
# the locked record.
def lock!(lock = true)
- reload(:lock => lock) unless new?
+ reload(:lock => lock) unless new_record?
self
end
end