Skip to content

Commit

Permalink
Support Psych version 4
Browse files Browse the repository at this point in the history
Fixes #1335

Psych's `.load` method uses `.safe_load` by default which is not compatible with papertail needs to load.

This implements the suggested fix in the issue which is a similar fix that Rails uses throughout its codebase when it needs to load YAML content.
  • Loading branch information
t27duck committed Sep 5, 2021
1 parent 9e82585 commit 499dc85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/paper_trail/serializers/yaml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module YAML
extend self # makes all instance methods become module methods as well

def load(string)
::YAML.load string
::YAML.respond_to?(:unsafe_load) ? ::YAML.unsafe_load(string) : ::YAML.load(string)
end

# @param object (Hash | HashWithIndifferentAccess) - Coming from
Expand Down

0 comments on commit 499dc85

Please sign in to comment.