Skip to content

Commit

Permalink
Merge pull request #7391 from CitizenLabDotCo/20240318/various-fixes
Browse files Browse the repository at this point in the history
[TAN-862] Solve Psych::DisallowedClass errors
  • Loading branch information
adessy authored Mar 18, 2024
2 parents 1e03196 + 9c59997 commit bf28c2b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def parse_yml(content)
YAML.load(
content,
aliases: true,
permitted_classes: [Date, Project, Symbol, Time]
permitted_classes: [Date, Time, Symbol, *ar_classes]
)
end
alias parse_yaml parse_yml
Expand All @@ -283,6 +283,13 @@ def parse_yml_file(file)

private

def ar_classes
@ar_classes ||= begin
Rails.application.eager_load! # Make sure all model classes are loaded.
ApplicationRecord.descendants
end
end

def template_locales(serialized_models)
locales = Set.new

Expand Down

0 comments on commit bf28c2b

Please sign in to comment.