summaryrefslogtreecommitdiffstats
path: root/config/initializers/10-patches.rb
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers/10-patches.rb')
-rw-r--r--config/initializers/10-patches.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/config/initializers/10-patches.rb b/config/initializers/10-patches.rb
index 881206c9e..7247d52a1 100644
--- a/config/initializers/10-patches.rb
+++ b/config/initializers/10-patches.rb
@@ -203,6 +203,30 @@ module ActionController
end
end
+if Rails::VERSION::MAJOR < 4 && RUBY_VERSION >= "2.1"
+ module ActiveSupport
+ class HashWithIndifferentAccess
+ def select(*args, &block)
+ dup.tap { |hash| hash.select!(*args, &block) }
+ end
+
+ def reject(*args, &block)
+ dup.tap { |hash| hash.reject!(*args, &block) }
+ end
+ end
+
+ class OrderedHash
+ def select(*args, &block)
+ dup.tap { |hash| hash.select!(*args, &block) }
+ end
+
+ def reject(*args, &block)
+ dup.tap { |hash| hash.reject!(*args, &block) }
+ end
+ end
+ end
+end
+
require 'awesome_nested_set/version'
module CollectiveIdea