From 27e30a9701178f65ca71ddfb56bcd1015b124363 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 19 Oct 2019 04:30:01 +0000 Subject: [PATCH] code cleanup: rubocop: fix Style/MultilineTernaryOperator in lib/redmine/utils.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18734 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .rubocop_todo.yml | 1 - lib/redmine/utils.rb | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9078a7fda..638446419 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1097,7 +1097,6 @@ Style/MultilineTernaryOperator: - 'lib/redmine/ciphering.rb' - 'lib/redmine/scm/adapters/filesystem_adapter.rb' - 'lib/redmine/scm/adapters/git_adapter.rb' - - 'lib/redmine/utils.rb' Style/MultipleComparison: Exclude: diff --git a/lib/redmine/utils.rb b/lib/redmine/utils.rb index a876070a8..d9a3819e6 100644 --- a/lib/redmine/utils.rb +++ b/lib/redmine/utils.rb @@ -24,9 +24,11 @@ module Redmine class << self # Returns the relative root url of the application def relative_url_root - ActionController::Base.respond_to?('relative_url_root') ? - ActionController::Base.relative_url_root.to_s : + if ActionController::Base.respond_to?('relative_url_root') + ActionController::Base.relative_url_root.to_s + else ActionController::Base.config.relative_url_root.to_s + end end # Sets the relative root url of the application