aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/CHANGELOG2
-rw-r--r--activesupport/lib/active_support/option_merger.rb2
-rw-r--r--activesupport/test/option_merger_test.rb5
3 files changed, 8 insertions, 1 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG
index 570b9b0988..5784e6d922 100644
--- a/activesupport/CHANGELOG
+++ b/activesupport/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Don't undefine #class in OptionMerger [Rick]
+
* Hash.create_from_xml has been renamed to Hash.from_xml, alias will exist until Rails 2.0 [DHH]
* alias_method_chain works with accessor= methods also. #6153 [Caio Chassot]
diff --git a/activesupport/lib/active_support/option_merger.rb b/activesupport/lib/active_support/option_merger.rb
index f944729bbc..e266d156ce 100644
--- a/activesupport/lib/active_support/option_merger.rb
+++ b/activesupport/lib/active_support/option_merger.rb
@@ -1,7 +1,7 @@
module ActiveSupport
class OptionMerger #:nodoc:
instance_methods.each do |method|
- undef_method(method) if method !~ /^(__|instance_eval)/
+ undef_method(method) if method !~ /^(__|instance_eval|class)/
end
def initialize(context, options)
diff --git a/activesupport/test/option_merger_test.rb b/activesupport/test/option_merger_test.rb
index db32d4f6c1..0cddfe8c21 100644
--- a/activesupport/test/option_merger_test.rb
+++ b/activesupport/test/option_merger_test.rb
@@ -38,6 +38,11 @@ class OptionMergerTest < Test::Unit::TestCase
end
end
+ # Needed when counting objects with the ObjectSpace
+ def test_option_merger_class_method
+ assert_equal ActiveSupport::OptionMerger, ActiveSupport::OptionMerger.new('', '').class
+ end
+
private
def method_with_options(options = {})
options