mirror of
https://github.com/redmine/redmine.git
synced 2025-11-10 15:26:03 +01:00
Fix RuboCop Style/RedundantCondition (#41884).
git-svn-id: https://svn.redmine.org/redmine/trunk@23627 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -1106,13 +1106,6 @@ Style/RedundantBegin:
|
||||
- 'test/unit/project_nested_set_concurrency_test.rb'
|
||||
- 'test/unit/query_test.rb'
|
||||
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Style/RedundantCondition:
|
||||
Exclude:
|
||||
- 'app/controllers/messages_controller.rb'
|
||||
- 'app/controllers/previews_controller.rb'
|
||||
- 'app/models/issue.rb'
|
||||
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Style/RedundantConditional:
|
||||
Exclude:
|
||||
|
||||
@@ -134,7 +134,7 @@ class MessagesController < ApplicationController
|
||||
|
||||
def preview
|
||||
message = @board.messages.find_by_id(params[:id])
|
||||
@text = params[:text] ? params[:text] : nil
|
||||
@text = params[:text] || nil
|
||||
@previewed = message
|
||||
render :partial => 'common/preview'
|
||||
end
|
||||
|
||||
@@ -26,7 +26,7 @@ class PreviewsController < ApplicationController
|
||||
if @issue
|
||||
@previewed = @issue
|
||||
end
|
||||
@text = params[:text] ? params[:text] : nil
|
||||
@text = params[:text] || nil
|
||||
render :partial => 'common/preview'
|
||||
end
|
||||
|
||||
@@ -34,12 +34,12 @@ class PreviewsController < ApplicationController
|
||||
if params[:id].present? && news = News.visible.find_by_id(params[:id])
|
||||
@previewed = news
|
||||
end
|
||||
@text = params[:text] ? params[:text] : nil
|
||||
@text = params[:text] || nil
|
||||
render :partial => 'common/preview'
|
||||
end
|
||||
|
||||
def text
|
||||
@text = params[:text] ? params[:text] : nil
|
||||
@text = params[:text] || nil
|
||||
render :partial => 'common/preview'
|
||||
end
|
||||
|
||||
|
||||
@@ -1203,11 +1203,7 @@ class Issue < ApplicationRecord
|
||||
end
|
||||
|
||||
def last_notes
|
||||
if @last_notes
|
||||
@last_notes
|
||||
else
|
||||
journals.visible.where.not(notes: '').reorder(:id => :desc).first.try(:notes)
|
||||
end
|
||||
@last_notes || journals.visible.where.not(notes: '').reorder(:id => :desc).first.try(:notes)
|
||||
end
|
||||
|
||||
# Preloads relations for a collection of issues
|
||||
|
||||
Reference in New Issue
Block a user