Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove special cases for duplicable? on Class and Module #6361

Merged
merged 1 commit into from May 17, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 0 additions & 24 deletions activesupport/lib/active_support/core_ext/object/duplicable.rb
Expand Up @@ -81,30 +81,6 @@ def duplicable?
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
Expand Down
4 changes: 2 additions & 2 deletions activesupport/test/core_ext/duplicable_test.rb
Expand Up @@ -5,8 +5,8 @@

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')
Expand Down