diff options
author | José Valim <jose.valim@gmail.com> | 2012-05-17 00:07:10 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-05-17 00:07:10 -0700 |
commit | 6950d74e18750434dbf76fd6749a7c8f393f53be (patch) | |
tree | 5207e0d924b9c3e76b5e5806350135212eaa7fd1 | |
parent | 313f292e27bfb093a59b8aee4d606f2c63391c7c (diff) | |
parent | 2f06d5842b4c5969c2013d25bea4078563a02b13 (diff) | |
download | rails-6950d74e18750434dbf76fd6749a7c8f393f53be.tar.gz rails-6950d74e18750434dbf76fd6749a7c8f393f53be.tar.bz2 rails-6950d74e18750434dbf76fd6749a7c8f393f53be.zip |
Merge pull request #6361 from markmcspadden/issue_6265
Remove special cases for duplicable? on Class and Module
-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') |