From f2a86577c51e7521db5eff38dc0238142bef821d Mon Sep 17 00:00:00 2001 From: Kazuyoshi Kato Date: Wed, 9 Oct 2024 22:22:30 -0700 Subject: [PATCH 1/2] Check all mailing lists by default --- app/controllers/messages_controller.rb | 3 +++ app/views/messages/index.html.erb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 0fdd1f0..b1ccad6 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -11,6 +11,9 @@ def index page = params[:page].to_i list_ids = get_list_ids(params) + if list_ids.empty? + raise "Need to select at least one list" + end # %> and <-> are defined by pg_trgm. # https://www.postgresql.org/docs/17/pgtrgm.html diff --git a/app/views/messages/index.html.erb b/app/views/messages/index.html.erb index 35e0de2..cdd2df6 100644 --- a/app/views/messages/index.html.erb +++ b/app/views/messages/index.html.erb @@ -16,7 +16,7 @@ ].each do |name, label| %> - <%= form.check_box name, {checked: params[name] == '1' } %> + <%= form.check_box name, {checked: params[name] != '0' } %> <%= form.label name, label %> <% end %> From 0519befa2ce93c5aa5b4582087f290be4ec691e8 Mon Sep 17 00:00:00 2001 From: Kazuyoshi Kato Date: Wed, 9 Oct 2024 22:36:25 -0700 Subject: [PATCH 2/2] Fix Review Apps --- Procfile | 3 +++ bin/heroku-release | 6 ++++++ 2 files changed, 9 insertions(+) create mode 100755 bin/heroku-release diff --git a/Procfile b/Procfile index e328812..5d66ea4 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1,5 @@ # https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server web: bundle exec puma -C config/puma.rb + +# https://devcenter.heroku.com/articles/release-phase +release: ./bin/heroku-release diff --git a/bin/heroku-release b/bin/heroku-release new file mode 100755 index 0000000..b90919c --- /dev/null +++ b/bin/heroku-release @@ -0,0 +1,6 @@ +#! /bin/bash +set -euo pipefail + +bundle exec rake db:migrate + +env