aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/array
diff options
context:
space:
mode:
authorAlexey Gaziev <alex.gaziev@gmail.com>2012-04-24 13:59:55 +0400
committerPiotr Sarnacki <drogus@gmail.com>2012-05-06 10:28:35 -0700
commit657b4ff04ad43bf26ded31ebfc003075f46dad53 (patch)
tree8f7edd930e1568fa98b87607de7e1bbb2f5ebe44 /activesupport/lib/active_support/core_ext/array
parented1703bcb206a740957c0a93df5f25177dedc0de (diff)
downloadrails-657b4ff04ad43bf26ded31ebfc003075f46dad53.tar.gz
rails-657b4ff04ad43bf26ded31ebfc003075f46dad53.tar.bz2
rails-657b4ff04ad43bf26ded31ebfc003075f46dad53.zip
Nice logic for deep_dup in rails
Diffstat (limited to 'activesupport/lib/active_support/core_ext/array')
-rw-r--r--activesupport/lib/active_support/core_ext/array/deep_dup.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/array/deep_dup.rb b/activesupport/lib/active_support/core_ext/array/deep_dup.rb
new file mode 100644
index 0000000000..82f9805236
--- /dev/null
+++ b/activesupport/lib/active_support/core_ext/array/deep_dup.rb
@@ -0,0 +1,6 @@
+class Array
+ # Returns a deep copy of array.
+ def deep_dup
+ map { |it| it.deep_dup }
+ end
+end