Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Enable YAML serialization of Symbol, Date, Time

Dombi Attilae4ab431d15c4
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 49ef1e064f2..53ed9ef2cac 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -67,6 +67,9 @@ OpenProject::Application.configure do
# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true
+ # Enable serialization of types [Symbol, Date, Time]
+ config.active_record.yaml_column_permitted_classes = [Symbol, Date, Time, ActiveSupport::HashWithIndifferentAccess]
+
# Disable compression and asset digests, but disable debug
config.assets.debug = false
config.assets.digest = false
diff --git a/config/environments/production.rb b/config/environments/production.rb
index b34f151c090..f1f126ef1f9 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -119,6 +119,9 @@ OpenProject::Application.configure do
config.active_record.dump_schema_after_migration = false
+ # Enable serialization of types [Symbol, Date, Time]
+ config.active_record.yaml_column_permitted_classes = [Symbol, Date, Time, ActiveSupport::HashWithIndifferentAccess]
+
if OpenProject::Configuration.enable_internal_assets_server?
config.public_file_server.enabled = true
config.public_file_server.headers = {
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 2d9a5ef27f6..6b423b25167 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -53,6 +53,9 @@ OpenProject::Application.configure do
config.consider_all_requests_local = true
config.action_controller.perform_caching = true
+ # Enable serialization of types [Symbol, Date, Time]
+ config.active_record.yaml_column_permitted_classes = [Symbol, Date, Time, ActiveSupport::HashWithIndifferentAccess]
+
# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false