From 7bc224dda00133dcb72c531d3b46391a88f21062 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Wed, 2 Jan 2013 09:37:44 +0900 Subject: [PATCH] remove meaningless AS::FrozenObjectError --- .../lib/action_dispatch/middleware/exception_wrapper.rb | 1 - activerecord/lib/active_record/aggregations.rb | 2 +- activerecord/test/cases/aggregations_test.rb | 3 +-- activerecord/test/cases/base_test.rb | 1 - activerecord/test/cases/persistence_test.rb | 5 ++--- activesupport/lib/active_support/cache.rb | 1 - activesupport/lib/active_support/core_ext/exception.rb | 3 --- 7 files changed, 4 insertions(+), 12 deletions(-) delete mode 100644 activesupport/lib/active_support/core_ext/exception.rb diff --git a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb index ee69c8b49d..58adf22862 100644 --- a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb +++ b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb @@ -1,5 +1,4 @@ require 'action_controller/metal/exceptions' -require 'active_support/core_ext/exception' require 'active_support/core_ext/class/attribute_accessors' module ActionDispatch diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb index 8101f7a45e..6acfec02c4 100644 --- a/activerecord/lib/active_record/aggregations.rb +++ b/activerecord/lib/active_record/aggregations.rb @@ -113,7 +113,7 @@ module ActiveRecord # other than the writer method. # # The immutable requirement is enforced by Active Record by freezing any object assigned as a value - # object. Attempting to change it afterwards will result in a ActiveSupport::FrozenObjectError. + # object. Attempting to change it afterwards will result in a RuntimeError. # # Read more about value objects on http://c2.com/cgi/wiki?ValueObject and on the dangers of not # keeping value objects immutable on http://c2.com/cgi/wiki?ValueObjectsShouldBeImmutable diff --git a/activerecord/test/cases/aggregations_test.rb b/activerecord/test/cases/aggregations_test.rb index 48b06a767f..10195e3ae4 100644 --- a/activerecord/test/cases/aggregations_test.rb +++ b/activerecord/test/cases/aggregations_test.rb @@ -1,6 +1,5 @@ require "cases/helper" require 'models/customer' -require 'active_support/core_ext/exception' class AggregationsTest < ActiveRecord::TestCase fixtures :customers @@ -26,7 +25,7 @@ class AggregationsTest < ActiveRecord::TestCase def test_immutable_value_objects customers(:david).balance = Money.new(100) - assert_raise(ActiveSupport::FrozenObjectError) { customers(:david).balance.instance_eval { @amount = 20 } } + assert_raise(RuntimeError) { customers(:david).balance.instance_eval { @amount = 20 } } end def test_inferred_mapping diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 518ce9763c..d6f1b5c2e5 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -26,7 +26,6 @@ require 'models/bird' require 'models/car' require 'models/bulb' require 'rexml/document' -require 'active_support/core_ext/exception' class FirstAbstractClass < ActiveRecord::Base self.abstract_class = true diff --git a/activerecord/test/cases/persistence_test.rb b/activerecord/test/cases/persistence_test.rb index 9e0423ab52..add18775d9 100644 --- a/activerecord/test/cases/persistence_test.rb +++ b/activerecord/test/cases/persistence_test.rb @@ -16,7 +16,6 @@ require 'models/person' require 'models/pet' require 'models/toy' require 'rexml/document' -require 'active_support/core_ext/exception' class PersistencesTest < ActiveRecord::TestCase @@ -365,7 +364,7 @@ class PersistencesTest < ActiveRecord::TestCase client.delete assert client.frozen? assert_kind_of Firm, client.firm - assert_raise(ActiveSupport::FrozenObjectError) { client.name = "something else" } + assert_raise(RuntimeError) { client.name = "something else" } end def test_destroy_new_record @@ -379,7 +378,7 @@ class PersistencesTest < ActiveRecord::TestCase client.destroy assert client.frozen? assert_kind_of Firm, client.firm - assert_raise(ActiveSupport::FrozenObjectError) { client.name = "something else" } + assert_raise(RuntimeError) { client.name = "something else" } end def test_update_attribute diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb index fdec2de1d5..5a5548d567 100644 --- a/activesupport/lib/active_support/cache.rb +++ b/activesupport/lib/active_support/cache.rb @@ -3,7 +3,6 @@ require 'zlib' require 'active_support/core_ext/array/extract_options' require 'active_support/core_ext/array/wrap' require 'active_support/core_ext/benchmark' -require 'active_support/core_ext/exception' require 'active_support/core_ext/class/attribute_accessors' require 'active_support/core_ext/numeric/bytes' require 'active_support/core_ext/numeric/time' diff --git a/activesupport/lib/active_support/core_ext/exception.rb b/activesupport/lib/active_support/core_ext/exception.rb deleted file mode 100644 index ba7757ea07..0000000000 --- a/activesupport/lib/active_support/core_ext/exception.rb +++ /dev/null @@ -1,3 +0,0 @@ -module ActiveSupport - FrozenObjectError = RuntimeError -end