diff options
author | Mark McSpadden <markmcspadden@gmail.com> | 2012-05-17 03:00:31 -0400 |
---|---|---|
committer | Mark McSpadden <markmcspadden@gmail.com> | 2012-05-17 03:00:31 -0400 |
commit | 2f06d5842b4c5969c2013d25bea4078563a02b13 (patch) | |
tree | 8bea77dd96e2e7fb5cc7e5e87034651f9c848814 /activesupport | |
parent | 47971a1eb586167f2c039849cbccfdebcea4241d (diff) | |
download | rails-2f06d5842b4c5969c2013d25bea4078563a02b13.tar.gz rails-2f06d5842b4c5969c2013d25bea4078563a02b13.tar.bz2 rails-2f06d5842b4c5969c2013d25bea4078563a02b13.zip |
Remove special cases for duplicable? on Class and Module
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/duplicable.rb | 24 | ||||
-rw-r--r-- | activesupport/test/core_ext/duplicable_test.rb | 4 |
2 files changed, 2 insertions, 26 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/duplicable.rb b/activesupport/lib/active_support/core_ext/object/duplicable.rb index 9d1630bb7c..dd63b64c77 100644 --- a/activesupport/lib/active_support/core_ext/object/duplicable.rb +++ b/activesupport/lib/active_support/core_ext/object/duplicable.rb @@ -81,30 +81,6 @@ class Numeric end end -class Class - # Classes are not duplicable: - # - # c = Class.new # => #<Class:0x10328fd80> - # c.dup # => #<Class:0x10328fd80> - # - # Note +dup+ returned the same class object. - def duplicable? - false - end -end - -class Module - # Modules are not duplicable: - # - # m = Module.new # => #<Module:0x10328b6e0> - # m.dup # => #<Module:0x10328b6e0> - # - # Note +dup+ returned the same module object. - def duplicable? - false - end -end - require 'bigdecimal' class BigDecimal begin diff --git a/activesupport/test/core_ext/duplicable_test.rb b/activesupport/test/core_ext/duplicable_test.rb index 1105353e45..e0566e012c 100644 --- a/activesupport/test/core_ext/duplicable_test.rb +++ b/activesupport/test/core_ext/duplicable_test.rb @@ -5,8 +5,8 @@ require 'active_support/core_ext/numeric/time' class DuplicableTest < ActiveSupport::TestCase RAISE_DUP = [nil, false, true, :symbol, 1, 2.3, 5.seconds] - YES = ['1', Object.new, /foo/, [], {}, Time.now] - NO = [Class.new, Module.new] + YES = ['1', Object.new, /foo/, [], {}, Time.now, Class.new, Module.new] + NO = [] begin bd = BigDecimal.new('4.56') |