From a341040ec67c44da9f0a3845c44792130dc56242 Mon Sep 17 00:00:00 2001 From: Diogo Vernier <10981831+diogovernier@users.noreply.github.com> Date: Fri, 27 Mar 2026 20:25:34 -0300 Subject: [PATCH] Fix store_accessor on MariaDB by declaring JSON attribute type MariaDB represents JSON columns as LONGTEXT, which causes Rails to map them to Type::Text instead of Type::Json. Since Type::Text lacks the accessor method that store_accessor requires, this raises ActiveRecord::ConfigurationError on MariaDB. Adding explicit `attribute :column, :json` declarations ensures the columns are typed as JSON regardless of what the database adapter reports. On MySQL this is a no-op (already Type::Json); on MariaDB it overrides Type::Text with Type::Json. Fixes #2402 --- app/models/event/particulars.rb | 1 + app/models/filter/fields.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/models/event/particulars.rb b/app/models/event/particulars.rb index 31ecd66bfa..de8cecf26e 100644 --- a/app/models/event/particulars.rb +++ b/app/models/event/particulars.rb @@ -2,6 +2,7 @@ module Event::Particulars extend ActiveSupport::Concern included do + attribute :particulars, :json store_accessor :particulars, :assignee_ids end diff --git a/app/models/filter/fields.rb b/app/models/filter/fields.rb index 0e1c62e0a4..fbbc8c3b09 100644 --- a/app/models/filter/fields.rb +++ b/app/models/filter/fields.rb @@ -30,6 +30,7 @@ def indexed_by_human_name(index) end included do + attribute :fields, :json store_accessor :fields, :assignment_status, :indexed_by, :sorted_by, :terms, :card_ids, :creation, :closure