diff options
| author | Frederick Cheung <frederick.cheung@gmail.com> | 2008-08-21 18:23:18 +0100 |
|---|---|---|
| committer | Pratik Naik <pratiknaik@gmail.com> | 2008-08-21 18:40:20 +0100 |
| commit | 654c41255d22b2767b943dbe970d8b24f2a1387b (patch) | |
| tree | 7e3eb141b80e8365eaaf8b3886c8f65397d2401d | |
| parent | bbedb6a624a3d9eb02e0470f31cda8112df06d75 (diff) | |
| download | rails-654c41255d22b2767b943dbe970d8b24f2a1387b.tar.gz rails-654c41255d22b2767b943dbe970d8b24f2a1387b.tar.bz2 rails-654c41255d22b2767b943dbe970d8b24f2a1387b.zip | |
Mark Class as not being duplicable. [#829 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
| -rw-r--r-- | activesupport/lib/active_support/core_ext/duplicable.rb | 6 | ||||
| -rw-r--r-- | activesupport/test/core_ext/duplicable_test.rb | 2 |
2 files changed, 7 insertions, 1 deletions
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 |
