Skip to content

Commit

Permalink
Fixes learned from a bad deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Eversmann committed Jun 25, 2014
1 parent 96aa676 commit a91ef5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions db/migrate/20140617214701_add_success_email.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ def change
add_column :repositories, :send_build_success_email, :boolean, :default => true, :null => false
reversible do |dir|
change_table :builds do |t|
dir.up { t.change :build_failure_email_sent, :boolean, :default => false, :null => false }
dir.up do
execute 'UPDATE builds SET build_failure_email_sent = 0 WHERE build_failure_email_sent IS NULL'
t.change :build_failure_email_sent, :boolean, :default => false, :null => false
end
dir.down { t.change :build_failure_email_sent, :boolean, :default => nil, :null => true }
end
change_table :repositories do |t|
dir.up { t.change :send_build_failure_email, :boolean, :default => true, :null => false }
dir.up do
execute 'UPDATE repositories SET send_build_failure_email = 1 WHERE send_build_failure_email IS NULL'
t.change :send_build_failure_email, :boolean, :default => true, :null => false
end
dir.down { t.change :send_build_failure_email, :boolean, :default => true, :null => true }
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/git_blame.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def last_git_name_and_email_in_branch(build)
end

def lookup_git_names_and_emails(git_names_and_emails)
git_names_and_emails.map do |git_name_and_email|
Array(git_names_and_emails).map do |git_name_and_email|
name, email = git_name_and_email.split(":")
Array(email_from_git_email(email))
end.flatten.compact.uniq
Expand Down

0 comments on commit a91ef5f

Please sign in to comment.