summaryrefslogtreecommitdiffstats
path: root/config/initializers
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-05-01 01:59:39 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-05-01 01:59:39 +0000
commit82fa2cf79a298c6e3a1b52f62b2f052caf334d88 (patch)
treeffcb9348478bfe94d9264694fdfafa5421177748 /config/initializers
parent4276fc306c6e2962240dafe1d86ee58b73ab0190 (diff)
downloadredmine-82fa2cf79a298c6e3a1b52f62b2f052caf334d88.tar.gz
redmine-82fa2cf79a298c6e3a1b52f62b2f052caf334d88.zip
add patch for regression of Hash#reject in Ruby 2.1.1 (#16194)
git-svn-id: http://svn.redmine.org/redmine/trunk@13115 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'config/initializers')
-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