From ccae5846e3a46967a3a7a3e0ad091e7c7f9ee60d Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 27 Sep 2016 14:04:44 +0700 Subject: [PATCH] Fix redmine version for render_project_jump_box `User.current.projects.active.select` is used since redmine [3.0.0](https://github.com/redmine/redmine/blob/3.0.0/app/helpers/application_helper.rb#L330). Redmine [2.6.9](https://github.com/redmine/redmine/blob/2.6.9/app/helpers/application_helper.rb#L337) still use `User.current.memberships.collect`. --- lib/application_helper_patch.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/application_helper_patch.rb b/lib/application_helper_patch.rb index 834e4fa..7752db0 100644 --- a/lib/application_helper_patch.rb +++ b/lib/application_helper_patch.rb @@ -12,7 +12,7 @@ def self.included(base) module InstanceMethods def render_project_jump_box_with_responsive return unless User.current.logged? - if Redmine::VERSION::MAJOR >= 2 + if Redmine::VERSION::MAJOR >= 3 projects = User.current.projects.active.select(:id, :name, :identifier, :lft, :rgt).to_a else projects = User.current.memberships.collect(&:project).compact.select(&:active?).uniq