From 5c4bf3b2a8912411d581cce8e58ba9b752a36169 Mon Sep 17 00:00:00 2001 From: moveson Date: Fri, 30 Jan 2026 18:57:34 -0700 Subject: [PATCH 1/3] Add prelude and postlude song types But don't return prelude or postlude songs for Unit#song_last_sung --- app/models/song.rb | 2 ++ app/models/unit.rb | 1 + spec/models/unit_spec.rb | 10 +++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/models/song.rb b/app/models/song.rb index e5d837e..14ae081 100644 --- a/app/models/song.rb +++ b/app/models/song.rb @@ -8,6 +8,8 @@ class Song < ApplicationRecord congregational_hymn: 2, musical_number: 3, closing_hymn: 4, + prelude: 5, + postlude: 6, } validates :song_type, :title, presence: true diff --git a/app/models/unit.rb b/app/models/unit.rb index 0f3730c..dc1c87d 100644 --- a/app/models/unit.rb +++ b/app/models/unit.rb @@ -38,6 +38,7 @@ def song_last_sung(title, date) songs.where("songs.title ilike ?", title) .where(meetings: { date: ...date }) + .where.not(song_type: [:prelude, :postlude]) .order("meetings.date desc") .first end diff --git a/spec/models/unit_spec.rb b/spec/models/unit_spec.rb index 86e6883..f87f412 100644 --- a/spec/models/unit_spec.rb +++ b/spec/models/unit_spec.rb @@ -55,7 +55,15 @@ let(:date) { "2022-04-10".to_date } context "when the song was sung previously" do - it { expect(result).to eq(songs(:song_1)) } + context "when sung as an opening song" do + it { expect(result).to eq(songs(:song_1)) } + end + + context "when played as a prelude song" do + before { songs(:song_1).update(song_type: :prelude) } + + it { expect(result).to be_nil } + end end context "when the song was sung after but not previously" do From b2314204defc5f38f1a8616e1b2584e460cf17f8 Mon Sep 17 00:00:00 2001 From: moveson Date: Fri, 30 Jan 2026 18:59:14 -0700 Subject: [PATCH 2/3] Update brakeman --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4f515f0..a32dd98 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -105,7 +105,7 @@ GEM bindex (0.8.1) bootsnap (1.18.6) msgpack (~> 1.2) - brakeman (7.1.0) + brakeman (8.0.1) racc builder (3.3.0) bundler-audit (0.9.2) From 034abb2afbd5ffa8a3f38c91fd9fcb06a4365293 Mon Sep 17 00:00:00 2001 From: moveson Date: Fri, 30 Jan 2026 19:01:36 -0700 Subject: [PATCH 3/3] Update aws sdk --- Gemfile.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a32dd98..1ea00d3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -80,8 +80,8 @@ GEM american_date (1.3.0) ast (2.4.3) aws-eventstream (1.4.0) - aws-partitions (1.1177.0) - aws-sdk-core (3.235.0) + aws-partitions (1.1211.0) + aws-sdk-core (3.241.4) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) @@ -89,11 +89,11 @@ GEM bigdecimal jmespath (~> 1, >= 1.6.1) logger - aws-sdk-kms (1.115.0) - aws-sdk-core (~> 3, >= 3.234.0) + aws-sdk-kms (1.121.0) + aws-sdk-core (~> 3, >= 3.241.4) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.201.0) - aws-sdk-core (~> 3, >= 3.234.0) + aws-sdk-s3 (1.213.0) + aws-sdk-core (~> 3, >= 3.241.4) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) aws-sigv4 (1.12.1) @@ -101,7 +101,7 @@ GEM base64 (0.3.0) bcrypt (3.1.20) benchmark (0.5.0) - bigdecimal (3.3.1) + bigdecimal (4.0.1) bindex (0.8.1) bootsnap (1.18.6) msgpack (~> 1.2)