Skip to content
Browse files

Merge pull request #5467 from bogdan/initialize_callbacks

ActiveRecord::Core#initialize: improve performance
  • Loading branch information...
2 parents f5b9dd3 + 791251b commit 6d0047aff8b7c333625d3a4b97dfa3e8a63588e2 @josevalim josevalim committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/core.rb
View
2 activerecord/lib/active_record/core.rb
@@ -176,7 +176,7 @@ def initialize(attributes = nil, options = {})
assign_attributes(attributes, options) if attributes
yield self if block_given?
- run_callbacks :initialize
+ run_callbacks :initialize if _initialize_callbacks.any?
end
# Initialize an empty model object from +coder+. +coder+ must contain

0 comments on commit 6d0047a

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