Don't undefine #class in OptionMerger [Rick]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5197 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Rick Olson
2006-09-27 18:46:46 +00:00
parent e537de00d8
commit d6925b14fa
3 changed files with 8 additions and 1 deletions

View File

@@ -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]

View File

@@ -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)

View File

@@ -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