summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-09-24 15:42:02 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-09-24 15:42:02 +0000
commitfe6b965fd5d9e2f3d7f346b53f6762ce5433e402 (patch)
tree28bb75e8187bbb95e81e1830bc335e69df0c9f41
parente83313240f38dc222923821be057312d5924a966 (diff)
downloadredmine-fe6b965fd5d9e2f3d7f346b53f6762ce5433e402.tar.gz
redmine-fe6b965fd5d9e2f3d7f346b53f6762ce5433e402.zip
code cleanup: rubocop: fix Rails/Presence in config/initializers/10-patches.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18520 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--.rubocop_todo.yml1
-rw-r--r--config/initializers/10-patches.rb2
2 files changed, 1 insertions, 2 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 043c4864e..ac5bd3574 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -959,7 +959,6 @@ Rails/Presence:
- 'app/controllers/activities_controller.rb'
- 'app/helpers/application_helper.rb'
- 'app/models/repository.rb'
- - 'config/initializers/10-patches.rb'
- 'config/initializers/30-redmine.rb'
- 'lib/redmine/codeset_util.rb'
- 'lib/redmine/i18n.rb'
diff --git a/config/initializers/10-patches.rb b/config/initializers/10-patches.rb
index e0559903b..9af59563e 100644
--- a/config/initializers/10-patches.rb
+++ b/config/initializers/10-patches.rb
@@ -97,7 +97,7 @@ module ActionView
alias :options_for_select_without_non_empty_blank_option :options_for_select
def options_for_select(container, selected = nil)
if container.is_a?(Array)
- container = container.map {|element| element.blank? ? ["&nbsp;".html_safe, ""] : element}
+ container = container.map {|element| element.presence || ["&nbsp;".html_safe, ""]}
end
options_for_select_without_non_empty_blank_option(container, selected)
end