From 654c41255d22b2767b943dbe970d8b24f2a1387b Mon Sep 17 00:00:00 2001 From: Frederick Cheung Date: Thu, 21 Aug 2008 18:23:18 +0100 Subject: Mark Class as not being duplicable. [#829 state:resolved] Signed-off-by: Pratik Naik --- activesupport/lib/active_support/core_ext/duplicable.rb | 6 ++++++ activesupport/test/core_ext/duplicable_test.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/activesupport/lib/active_support/core_ext/duplicable.rb b/activesupport/lib/active_support/core_ext/duplicable.rb index adbbfd8c60..8f49ddfd9e 100644 --- a/activesupport/lib/active_support/core_ext/duplicable.rb +++ b/activesupport/lib/active_support/core_ext/duplicable.rb @@ -35,3 +35,9 @@ class Numeric #:nodoc: false end end + +class Class #:nodoc: + def duplicable? + false + end +end diff --git a/activesupport/test/core_ext/duplicable_test.rb b/activesupport/test/core_ext/duplicable_test.rb index 3ccfedccd7..8b6127f31e 100644 --- a/activesupport/test/core_ext/duplicable_test.rb +++ b/activesupport/test/core_ext/duplicable_test.rb @@ -1,7 +1,7 @@ require 'abstract_unit' class DuplicableTest < Test::Unit::TestCase - NO = [nil, false, true, :symbol, 1, 2.3, BigDecimal.new('4.56')] + NO = [nil, false, true, :symbol, 1, 2.3, BigDecimal.new('4.56'), Class.new] YES = ['1', Object.new, /foo/, [], {}, Time.now] def test_duplicable -- cgit v1.2.3