From f2e4bf218f95ab279e1a1527c37115faf65ac283 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 10 May 2008 10:47:49 -0500 Subject: Use #duplicable? instead of anonymous rescue --- .../lib/active_support/core_ext/class/inheritable_attributes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb b/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb index 371d074d34..8724a492bf 100644 --- a/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb +++ b/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb @@ -128,7 +128,7 @@ class Class # :nodoc: new_inheritable_attributes = EMPTY_INHERITABLE_ATTRIBUTES else new_inheritable_attributes = inheritable_attributes.inject({}) do |memo, (key, value)| - memo.update(key => (value.dup rescue value)) + memo.update(key => value.duplicable? ? value.dup : value) end end -- cgit v1.2.3