Skip to content

Commit

Permalink
PR comments + rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcornu committed May 3, 2019
1 parent eda809c commit 8b59e89
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/models/shipit/stack.rb
Expand Up @@ -241,7 +241,7 @@ def status

def lock_reverted_commits!
backlog = undeployed_commits.to_a
affected = 0
affected_rows = 0

until backlog.empty?
backlog = backlog.drop_while { |c| !c.revert? }
Expand All @@ -251,12 +251,12 @@ def lock_reverted_commits!
commits_to_lock = backlog.reverse.drop_while { |c| !revert.revert_of?(c) }
next if commits_to_lock.empty?

affected += commits
.where(id: commits_to_lock.map(&:id).uniq)
.lock_all(revert.author)
affected_rows += commits
.where(id: commits_to_lock.map(&:id).uniq)
.lock_all(revert.author)
end

touch if affected > 1
touch if affected_rows > 1
end

def next_expected_commit_to_deploy(commits: nil)
Expand Down

0 comments on commit 8b59e89

Please sign in to comment.