Skip to content

Commit

Permalink
Merge pull request #4019 from bgeuken/remove_rubocop_disables
Browse files Browse the repository at this point in the history
Remove rubocop disables
  • Loading branch information
David Kang committed Oct 16, 2017
2 parents 550a8c4 + a647b34 commit ec59c15
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 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
4 changes: 1 addition & 3 deletions src/api/spec/models/bs_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,7 @@
end

it 'does not change the priority of the bs request' do
# rubocop:disable Lint/AmbiguousBlockAssociation
expect { bs_request.sanitize! }.not_to change{ HistoryElement::RequestPriorityChange.count }
# rubocop:enable Lint/AmbiguousBlockAssociation
expect { bs_request.sanitize! }.not_to(change { HistoryElement::RequestPriorityChange.count })
expect(bs_request.priority).to eq('moderate')
end
end
Expand Down

0 comments on commit ec59c15

Please sign in to comment.