-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix store_accessor on MariaDB by declaring JSON attribute type #2769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -30,6 +30,7 @@ def indexed_by_human_name(index) | |||||||||
| end | ||||||||||
|
|
||||||||||
| included do | ||||||||||
| attribute :fields, :json | ||||||||||
|
||||||||||
| attribute :fields, :json | |
| if respond_to?(:columns_hash) && columns_hash["fields"]&.type == :json | |
| attribute :fields, :json | |
| end |
There was a problem hiding this comment.
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 :particularskeeps working. For example, define a temporary test table/model with a:textparticularscolumn, includeEvent::Particulars, and assert setting/readingassignee_idsdoes not raiseActiveRecord::ConfigurationError.