Add and apply Style/SafeNavigation rubocop rule

We were already using it most of the time, but not always.
This commit is contained in:
Javi Martín
2019-10-10 03:02:45 +02:00
parent 6ceca143b4
commit 1004ac01f8
10 changed files with 22 additions and 19 deletions

View File

@@ -30,7 +30,7 @@ class Legislation::DraftVersionsController < Legislation::BaseController
private
def visible_draft_versions
if current_user && current_user.administrator?
if current_user&.administrator?
@process.draft_versions
else
@process.draft_versions.published

View File

@@ -47,7 +47,7 @@ class Legislation::ProcessesController < Legislation::BaseController
set_process
@phase = :debate_phase
if @process.debate_phase.started? || (current_user && current_user.administrator?)
if @process.debate_phase.started? || (current_user&.administrator?)
render :debate
else
render :phase_not_open
@@ -139,7 +139,7 @@ class Legislation::ProcessesController < Legislation::BaseController
@proposals = @proposals.send(@current_filter).page(params[:page])
end
if @process.proposals_phase.started? || (current_user && current_user.administrator?)
if @process.proposals_phase.started? || (current_user&.administrator?)
legislation_proposal_votes(@proposals)
render :proposals
else