diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb index 5d723d664867eb7d9e28fea24e3c039aeb0ddfa6..3d497a30fb2b3c154cc1bead52bd2b809aa32d77 100644 --- a/activerecord/lib/active_record/aggregations.rb +++ b/activerecord/lib/active_record/aggregations.rb @@ -104,11 +104,6 @@ def init_internals # :nodoc: # customer.address_city = "Copenhagen" # customer.address # => Address.new("Hyancintvej", "Copenhagen") # - # customer.address_street = "Vesterbrogade" - # customer.address # => Address.new("Hyancintvej", "Copenhagen") - # customer.send(:clear_aggregation_cache) - # customer.address # => Address.new("Vesterbrogade", "Copenhagen") - # # customer.address = Address.new("May Street", "Chicago") # customer.address_street # => "May Street" # customer.address_city # => "Chicago" diff --git a/activerecord/test/cases/associations_test.rb b/activerecord/test/cases/associations_test.rb index 1b3bacca64042a3a3dad8e8a4981b47344a283a5..3d202a552741c47d604a0dfed9e90de5372a4221 100644 --- a/activerecord/test/cases/associations_test.rb +++ b/activerecord/test/cases/associations_test.rb @@ -43,28 +43,6 @@ def test_subselect assert_equal favs, fav2 end - def test_clear_association_cache_stored - firm = Firm.find(1) - assert_kind_of Firm, firm - - firm.send(:clear_association_cache) - assert_equal Firm.find(1).clients.collect(&:name).sort, firm.clients.collect(&:name).sort - end - - def test_clear_association_cache_new_record - firm = Firm.new - client_stored = Client.find(3) - client_new = Client.new - client_new.name = "The Joneses" - clients = [ client_stored, client_new ] - - firm.clients << clients - assert_equal clients.map(&:name).to_set, firm.clients.map(&:name).to_set - - firm.send(:clear_association_cache) - assert_equal clients.map(&:name).to_set, firm.clients.map(&:name).to_set - end - def test_loading_the_association_target_should_keep_child_records_marked_for_destruction ship = Ship.create!(:name => "The good ship Dollypop") part = ship.parts.create!(:name => "Mast") diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 76907c832f2299fa2a9690abb5623cc5d7412d1d..993350ebd637a0fc99c78c7c822fdf279b428ad9 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -812,7 +812,6 @@ def test_dup_with_aggregate_of_same_name_as_attribute def test_dup_does_not_copy_associations author = authors(:david) assert_not_equal [], author.posts - author.send(:clear_association_cache) author_dup = author.dup assert_equal [], author_dup.posts