diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-01-17 00:10:25 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-01-17 00:10:25 -0200 |
commit | 5402b72faafecfa1eda8afce0e0f194fcf385fe3 (patch) | |
tree | 31c5d2d901c6d80ebb8d54ab96ba8cf12bf693cd /activesupport/lib/active_support | |
parent | 7252b43c6ecd31a023399085165b1cea9d1306f5 (diff) | |
download | rails-5402b72faafecfa1eda8afce0e0f194fcf385fe3.tar.gz rails-5402b72faafecfa1eda8afce0e0f194fcf385fe3.tar.bz2 rails-5402b72faafecfa1eda8afce0e0f194fcf385fe3.zip |
Remove warnings on Ruby 2.1
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/hash_with_indifferent_access.rb | 6 | ||||
-rw-r--r-- | activesupport/lib/active_support/ordered_hash.rb | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb index f690eab604..42f5e64306 100644 --- a/activesupport/lib/active_support/hash_with_indifferent_access.rb +++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb @@ -228,7 +228,11 @@ module ActiveSupport def to_options!; self end def select(*args, &block) - dup.tap {|hash| hash.select!(*args, &block)} + dup.tap { |hash| hash.select!(*args, &block)} + end + + def reject(*args, &block) + dup.tap { |hash| hash.reject!(*args, &block)} end # Convert to a regular hash with string keys. diff --git a/activesupport/lib/active_support/ordered_hash.rb b/activesupport/lib/active_support/ordered_hash.rb index 1a3693f766..8b320f6d05 100644 --- a/activesupport/lib/active_support/ordered_hash.rb +++ b/activesupport/lib/active_support/ordered_hash.rb @@ -28,6 +28,10 @@ module ActiveSupport coder.represent_seq '!omap', map { |k,v| { k => v } } end + def reject(*args, &block) + dup.tap { |hash| hash.reject!(*args, &block)} + end + def nested_under_indifferent_access self end |