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/project_nested_set_concurrency_test.rb'
|
||||||
- 'test/unit/query_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).
|
# This cop supports safe autocorrection (--autocorrect).
|
||||||
Style/RedundantConditional:
|
Style/RedundantConditional:
|
||||||
Exclude:
|
Exclude:
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ class MessagesController < ApplicationController
|
|||||||
|
|
||||||
def preview
|
def preview
|
||||||
message = @board.messages.find_by_id(params[:id])
|
message = @board.messages.find_by_id(params[:id])
|
||||||
@text = params[:text] ? params[:text] : nil
|
@text = params[:text] || nil
|
||||||
@previewed = message
|
@previewed = message
|
||||||
render :partial => 'common/preview'
|
render :partial => 'common/preview'
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class PreviewsController < ApplicationController
|
|||||||
if @issue
|
if @issue
|
||||||
@previewed = @issue
|
@previewed = @issue
|
||||||
end
|
end
|
||||||
@text = params[:text] ? params[:text] : nil
|
@text = params[:text] || nil
|
||||||
render :partial => 'common/preview'
|
render :partial => 'common/preview'
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -34,12 +34,12 @@ class PreviewsController < ApplicationController
|
|||||||
if params[:id].present? && news = News.visible.find_by_id(params[:id])
|
if params[:id].present? && news = News.visible.find_by_id(params[:id])
|
||||||
@previewed = news
|
@previewed = news
|
||||||
end
|
end
|
||||||
@text = params[:text] ? params[:text] : nil
|
@text = params[:text] || nil
|
||||||
render :partial => 'common/preview'
|
render :partial => 'common/preview'
|
||||||
end
|
end
|
||||||
|
|
||||||
def text
|
def text
|
||||||
@text = params[:text] ? params[:text] : nil
|
@text = params[:text] || nil
|
||||||
render :partial => 'common/preview'
|
render :partial => 'common/preview'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1203,11 +1203,7 @@ class Issue < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def last_notes
|
def last_notes
|
||||||
if @last_notes
|
@last_notes || journals.visible.where.not(notes: '').reorder(:id => :desc).first.try(:notes)
|
||||||
@last_notes
|
|
||||||
else
|
|
||||||
journals.visible.where.not(notes: '').reorder(:id => :desc).first.try(:notes)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Preloads relations for a collection of issues
|
# Preloads relations for a collection of issues
|
||||||
|
|||||||
Reference in New Issue
Block a user