diff --git a/app/models/condition.rb b/app/models/condition.rb index ef0d79cca..fd1379300 100644 --- a/app/models/condition.rb +++ b/app/models/condition.rb @@ -28,9 +28,9 @@ class Condition < ApplicationRecord belongs_to :question enum action_type: %i[remove add_webhook] - serialize :option_list, Array - serialize :remove_data, Array - serialize :webhook_data, JSON + serialize :option_list, type: Array + serialize :remove_data, type: Array + serialize :webhook_data, coder: JSON # Sort order: Number ASC default_scope { order(number: :asc) } diff --git a/app/models/org.rb b/app/models/org.rb index 2f7aa76bb..92122900e 100644 --- a/app/models/org.rb +++ b/app/models/org.rb @@ -54,7 +54,7 @@ class Org < ApplicationRecord # The links are validated against custom validator allocated at # validators/template_links_validator.rb attribute :links, :text, default: { org: [] } - serialize :links, JSON + serialize :links, coder: JSON # ================ # = Associations = diff --git a/app/models/pref.rb b/app/models/pref.rb index 01f83ee17..65af0fedc 100644 --- a/app/models/pref.rb +++ b/app/models/pref.rb @@ -13,7 +13,7 @@ class Pref < ApplicationRecord ## # Serialize prefs to JSON - serialize :settings, JSON + serialize :settings, coder: JSON # ================ # = Associations = diff --git a/app/models/stat_created_plan.rb b/app/models/stat_created_plan.rb index 6ba26d227..4c2c7f2c1 100644 --- a/app/models/stat_created_plan.rb +++ b/app/models/stat_created_plan.rb @@ -19,7 +19,7 @@ # Object that represents a Nbr of Plans created usage statistic class StatCreatedPlan < Stat - serialize :details, JSON + serialize :details, coder: JSON def by_template parse_details.fetch('by_template', []) diff --git a/app/models/template.rb b/app/models/template.rb index 6cbb3c3e4..4e83978b6 100644 --- a/app/models/template.rb +++ b/app/models/template.rb @@ -53,7 +53,7 @@ class Template < ApplicationRecord # The links is validated against custom validator allocated at # validators/template_links_validator.rb attribute :links, :text, default: { funder: [], sample_plan: [] } - serialize :links, JSON + serialize :links, coder: JSON attribute :published, :boolean, default: false attribute :archived, :boolean, default: false diff --git a/app/models/user.rb b/app/models/user.rb index c3ff35796..4d93247c4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -70,7 +70,7 @@ class User < ApplicationRecord ## # User Notification Preferences - serialize :prefs, Hash + serialize :prefs, type: Hash # default user language to the default language attribute :language_id, :integer, default: -> { Language.default&.id } diff --git a/config/environments/test.rb b/config/environments/test.rb index 179bb104b..122ad051b 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -31,7 +31,7 @@ config.action_controller.perform_caching = false # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false + config.action_dispatch.show_exceptions = :none # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false