From 634c53ac0ec6e4036870d79783daa403bf46dad2 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 26 Jun 2018 09:15:55 -0700 Subject: Call initialize after allocate If someone calls allocate on the object, they'd better also call an initialization routine too (you can't expect allocate to do any initialization work). Before this commit, AR objects that are instantiated from the database would call `define_attribute_methods` twice. --- activerecord/lib/active_record/core.rb | 5 ----- 1 file changed, 5 deletions(-) (limited to 'activerecord/lib/active_record/core.rb') diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index e1a0b2ecf8..e03c86f48c 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -139,11 +139,6 @@ module ActiveRecord end module ClassMethods # :nodoc: - def allocate - define_attribute_methods - super - end - def initialize_find_by_cache # :nodoc: @find_by_statement_cache = { true => Concurrent::Map.new, false => Concurrent::Map.new } end -- cgit v1.2.3