diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-10-28 16:53:34 -0400 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-10-28 16:54:00 -0400 |
commit | 8dcf91ca113579646e95b0fd7a864dfb6512a53b (patch) | |
tree | a09c95f00336eda7d48055b5973efbdd8e70b09c /activesupport | |
parent | 427a7385eb9b784ad4372bf607217b0b7b2ca543 (diff) | |
download | rails-8dcf91ca113579646e95b0fd7a864dfb6512a53b.tar.gz rails-8dcf91ca113579646e95b0fd7a864dfb6512a53b.tar.bz2 rails-8dcf91ca113579646e95b0fd7a864dfb6512a53b.zip |
First pass at cleaning up action caching
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/hash/slice.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/slice.rb b/activesupport/lib/active_support/core_ext/hash/slice.rb index 7aa394d7bf..e4a864c20f 100644 --- a/activesupport/lib/active_support/core_ext/hash/slice.rb +++ b/activesupport/lib/active_support/core_ext/hash/slice.rb @@ -29,4 +29,10 @@ class Hash replace(hash) omit end + + def extract!(*keys) + result = {} + keys.each {|key| result[key] = delete(key) } + result + end end |