浏览代码

code cleanup: rubocop: fix Style/ParenthesesAroundCondition in app/helpers/application_helper.rb

git-svn-id: http://svn.redmine.org/redmine/trunk@18822 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/4.1.0
Toshi MARUYAMA 4 年前
父节点
当前提交
8d429120ec
共有 2 个文件被更改,包括 3 次插入4 次删除
  1. 0
    1
      .rubocop_todo.yml
  2. 3
    3
      app/helpers/application_helper.rb

+ 0
- 1
.rubocop_todo.yml 查看文件

@@ -1161,7 +1161,6 @@ Style/ParallelAssignment:
# Configuration parameters: AllowSafeAssignment, AllowInMultilineConditions.
Style/ParenthesesAroundCondition:
Exclude:
- 'app/helpers/application_helper.rb'
- 'app/models/project.rb'
- 'app/models/query.rb'
- 'app/models/repository/subversion.rb'

+ 3
- 3
app/helpers/application_helper.rb 查看文件

@@ -67,7 +67,7 @@ module ApplicationHelper
def link_to_group(group, options={})
if group.is_a?(Group)
name = h(group.name)
if (User.current.admin?)
if User.current.admin?
only_path = options[:only_path].nil? ? true : options[:only_path]
link_to name, edit_group_path(group, :only_path => only_path)
else
@@ -377,12 +377,12 @@ module ApplicationHelper
projects.sort_by(&:lft).each do |project|
# set the project environment to please macros.
@project = project
if (ancestors.empty? || project.is_descendant_of?(ancestors.last))
if ancestors.empty? || project.is_descendant_of?(ancestors.last)
s << "<ul class='projects #{ ancestors.empty? ? 'root' : nil}'>\n"
else
ancestors.pop
s << "</li>"
while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
while ancestors.any? && !project.is_descendant_of?(ancestors.last)
ancestors.pop
s << "</ul></li>\n"
end

正在加载...
取消
保存