Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,23 @@ jobs:
db_adapter: sqlite
- mode: MySQL
db_adapter: mysql
db_image: mysql:8.0
db_health: mysqladmin ping
- mode: MariaDB
db_adapter: mysql
db_image: mariadb:11
db_health: healthcheck.sh --connect --innodb_initialized

services:
mysql:
image: mysql:8.0
db:
image: ${{ matrix.db_image || 'mysql:8.0' }}
Comment on lines +36 to +37
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: fizzy_test
Comment on lines 38 to 40
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-cmd="${{ matrix.db_health || 'mysqladmin ping' }}"
--health-interval=10s
--health-timeout=5s
--health-retries=3
Expand Down
1 change: 1 addition & 0 deletions app/models/event/particulars.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module Event::Particulars
extend ActiveSupport::Concern

included do
attribute :particulars, :json

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a regression test for the MariaDB JSON-as-LONGTEXT scenario to ensure store_accessor :particulars keeps working. For example, define a temporary test table/model with a :text particulars column, include Event::Particulars, and assert setting/reading assignee_ids does not raise ActiveRecord::ConfigurationError.

Copilot uses AI. Check for mistakes.
store_accessor :particulars, :assignee_ids
end

Expand Down
1 change: 1 addition & 0 deletions app/models/filter/fields.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def indexed_by_human_name(index)
end

included do
attribute :fields, :json

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a regression test that fails when the backing column is treated as text (MariaDB JSON-as-LONGTEXT) to ensure store_accessor :fields continues to work. One approach is a small test model/table with a :text fields column that includes Filter::Fields and asserts reading/writing a store accessor does not raise ActiveRecord::ConfigurationError.

Suggested change
attribute :fields, :json
if respond_to?(:columns_hash) && columns_hash["fields"]&.type == :json
attribute :fields, :json
end

Copilot uses AI. Check for mistakes.
store_accessor :fields, :assignment_status, :indexed_by, :sorted_by, :terms,
:card_ids, :creation, :closure

Expand Down
8 changes: 4 additions & 4 deletions test/fixtures/events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ logo_assignment_jz:
board: writebook_uuid
eventable: logo_uuid (Card)
action: card_assigned
particulars: <%= { assignee_ids: [ ActiveRecord::FixtureSet.identify("jz", :uuid) ] }.to_json %>
particulars: '<%= { assignee_ids: [ ActiveRecord::FixtureSet.identify("jz", :uuid) ] }.to_json %>'
created_at: <%= 1.week.ago + 1.hour %>
account: 37s_uuid

Expand All @@ -23,7 +23,7 @@ logo_assignment_david:
board: writebook_uuid
eventable: logo_uuid (Card)
action: card_assigned
particulars: <%= { assignee_ids: [ ActiveRecord::FixtureSet.identify("david", :uuid) ] }.to_json %>
particulars: '<%= { assignee_ids: [ ActiveRecord::FixtureSet.identify("david", :uuid) ] }.to_json %>'
created_at: <%= 1.week.ago + 1.hour %>
account: 37s_uuid

Expand All @@ -33,7 +33,7 @@ logo_assignment_km:
board: writebook_uuid
eventable: logo_uuid (Card)
action: card_assigned
particulars: <%= { assignee_ids: [ ActiveRecord::FixtureSet.identify("kevin", :uuid) ] }.to_json %>
particulars: '<%= { assignee_ids: [ ActiveRecord::FixtureSet.identify("kevin", :uuid) ] }.to_json %>'
created_at: <%= 1.day.ago %>
account: 37s_uuid

Expand Down Expand Up @@ -61,7 +61,7 @@ layout_assignment_jz:
board: writebook_uuid
eventable: layout_uuid (Card)
action: card_assigned
particulars: <%= { assignee_ids: [ ActiveRecord::FixtureSet.identify("jz", :uuid) ] }.to_json %>
particulars: '<%= { assignee_ids: [ ActiveRecord::FixtureSet.identify("jz", :uuid) ] }.to_json %>'
created_at: <%= 1.hour.ago %>
account: 37s_uuid

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/filters.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
jz_assignments:
id: <%= ActiveRecord::FixtureSet.identify("jz_assignments", :uuid) %>
creator: david_uuid
fields: <%= { indexed_by: :all, sorted_by: :newest }.to_json %>
fields: '<%= { indexed_by: :all, sorted_by: :newest }.to_json %>'
params_digest: <%= Filter.digest_params({ indexed_by: :all, sorted_by: :newest, tag_ids: [ ActiveRecord::FixtureSet.identify("mobile", :uuid) ], assignee_ids: [ ActiveRecord::FixtureSet.identify("jz", :uuid) ] }) %>
account: 37s_uuid