Skip to content

Commit

Permalink
[frontend] Remove rubocop disable
Browse files Browse the repository at this point in the history
Write condition as guard clause and remove rubocop disable.
  • Loading branch information
bgeuken committed Oct 15, 2017
1 parent ec04029 commit 477c83f
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/api/app/models/bs_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1185,19 +1185,15 @@ def check_bs_request_actions!(opts = {})
raisepriority(action.minimum_priority)
end

return unless persisted?

# rubocop:disable Style/GuardClause
if priority_changed?
HistoryElement::RequestPriorityChange.create({
request: self,
# We need to have a user here
user: User.find_nobody!,
description_extension: "#{priority_was} => #{priority}",
comment: "Automatic priority bump: Priority of related action increased."
})
end
# rubocop:enable Style/GuardClause
return unless persisted? && priority_changed?

HistoryElement::RequestPriorityChange.create({
request: self,
# We need to have a user here
user: User.find_nobody!,
description_extension: "#{priority_was} => #{priority}",
comment: "Automatic priority bump: Priority of related action increased."
})
end

def _assignreview_update_reviews(reviewer, opts, new_review = nil)
Expand Down

0 comments on commit 477c83f

Please sign in to comment.