diff options
author | Aaron Patterson <tenderlove@github.com> | 2018-06-26 10:20:22 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-26 10:20:22 -0700 |
commit | 7c769234f6070e9dcc17f92d448e770358dd57e4 (patch) | |
tree | 8e7578fbdfce37efc39dd36fbc1604bd42d0bee8 /activerecord | |
parent | cc0e84f9bfa89750ceca38db47ce5657cc373c3d (diff) | |
parent | 634c53ac0ec6e4036870d79783daa403bf46dad2 (diff) | |
download | rails-7c769234f6070e9dcc17f92d448e770358dd57e4.tar.gz rails-7c769234f6070e9dcc17f92d448e770358dd57e4.tar.bz2 rails-7c769234f6070e9dcc17f92d448e770358dd57e4.zip |
Merge pull request #33227 from rails/remove-allocate
Call initialize after allocate
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/core.rb | 5 | ||||
-rw-r--r-- | activerecord/test/cases/attribute_methods_test.rb | 13 |
2 files changed, 0 insertions, 18 deletions
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 diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index 434d32846c..0bfd46a522 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -163,19 +163,6 @@ class AttributeMethodsTest < ActiveRecord::TestCase assert_equal "10", keyboard.read_attribute_before_type_cast(:key_number) end - # Syck calls respond_to? before actually calling initialize. - test "respond_to? with an allocated object" do - klass = Class.new(ActiveRecord::Base) do - self.table_name = "topics" - end - - topic = klass.allocate - assert_not_respond_to topic, "nothingness" - assert_not_respond_to topic, :nothingness - assert_respond_to topic, "title" - assert_respond_to topic, :title - end - # IRB inspects the return value of MyModel.allocate. test "allocated objects can be inspected" do topic = Topic.allocate |