aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-12-14 15:41:34 +0000
committerJon Leighton <j@jonathanleighton.com>2011-12-14 16:14:47 +0000
commit7b0edbb9f2548b9e88979c737152079c41ed0ab7 (patch)
tree66ab3cff0988485bf6cc5ba10cb4028d0805697b /activerecord
parente3a4eb4b4067ee7d906babd029e60565001f7808 (diff)
downloadrails-7b0edbb9f2548b9e88979c737152079c41ed0ab7.tar.gz
rails-7b0edbb9f2548b9e88979c737152079c41ed0ab7.tar.bz2
rails-7b0edbb9f2548b9e88979c737152079c41ed0ab7.zip
Avoid super; speeds up Model.new by about 12%
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/locking/optimistic.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/locking/optimistic.rb b/activerecord/lib/active_record/locking/optimistic.rb
index 531f104c02..ce0a165660 100644
--- a/activerecord/lib/active_record/locking/optimistic.rb
+++ b/activerecord/lib/active_record/locking/optimistic.rb
@@ -65,7 +65,7 @@ module ActiveRecord
end
def attributes_from_column_definition
- result = super
+ result = self.class.column_defaults.dup
# If the locking column has no default value set,
# start the lock version at zero. Note we can't use