解决ruby2.3执行sql出错的bug

This commit is contained in:
guange 2016-08-01 19:17:16 +08:00
parent fc38ef6a3f
commit a1d3bbbfa9
1 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,15 @@
#coding=utf-8
#
require 'active_record'
## ruby2.3在这个rails版本的activerecord有bug, 直接用respond_to?(:to_proc)作判断
#而ruby2.3中hash可以返回 to_proc
if RUBY_VERSION > '2.3' && Rails.version < '3.2.22.3'
Hash.class_eval do
remove_method :to_proc
end
end
module ActiveRecord
class Base
include Redmine::I18n