Skip to content
This repository
Browse code

Merge pull request #5467 from bogdan/initialize_callbacks

ActiveRecord::Core#initialize: improve performance
  • Loading branch information...
commit 6d0047aff8b7c333625d3a4b97dfa3e8a63588e2 2 parents f5b9dd3 + 791251b
José Valim authored March 16, 2012

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  activerecord/lib/active_record/core.rb
2  activerecord/lib/active_record/core.rb
@@ -176,7 +176,7 @@ def initialize(attributes = nil, options = {})
176 176
       assign_attributes(attributes, options) if attributes
177 177
 
178 178
       yield self if block_given?
179  
-      run_callbacks :initialize
  179
+      run_callbacks :initialize if _initialize_callbacks.any?
180 180
     end
181 181
 
182 182
     # Initialize an empty model object from +coder+. +coder+ must contain

0 notes on commit 6d0047a

Please sign in to comment.
Something went wrong with that request. Please try again.