Skip to content

Commit d689c48

Browse files
authored
Merge pull request #14 from ruby/check-all
Check all mailing lists by default
2 parents 2089b89 + 0519bef commit d689c48

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

Procfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server
22
web: bundle exec puma -C config/puma.rb
3+
4+
# https://devcenter.heroku.com/articles/release-phase
5+
release: ./bin/heroku-release

app/controllers/messages_controller.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ def index
1111

1212
page = params[:page].to_i
1313
list_ids = get_list_ids(params)
14+
if list_ids.empty?
15+
raise "Need to select at least one list"
16+
end
1417

1518
# %> and <-> are defined by pg_trgm.
1619
# https://www.postgresql.org/docs/17/pgtrgm.html

app/views/messages/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
].each do |name, label|
1717
%>
1818
<span>
19-
<%= form.check_box name, {checked: params[name] == '1' } %>
19+
<%= form.check_box name, {checked: params[name] != '0' } %>
2020
<%= form.label name, label %>
2121
</span>
2222
<% end %>

bin/heroku-release

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#! /bin/bash
2+
set -euo pipefail
3+
4+
bundle exec rake db:migrate
5+
6+
env

0 commit comments

Comments
 (0)