Skip to content

Commit

Permalink
Set ActiveRecord::Base.use_yaml_unsafe_load to true
Browse files Browse the repository at this point in the history
  • Loading branch information
jkowens committed Jul 26, 2022
1 parent ed0c456 commit 612c874
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ class ActiveRecord::ConnectionAdapters::Mysql2Adapter
ActiveRecord::Base.logger = Logger.new("log/test.log")
ActiveRecord::Base.logger.level = Logger::DEBUG

if ActiveRecord.respond_to?(:use_yaml_unsafe_load)
ActiveRecord.use_yaml_unsafe_load = true
elsif ActiveRecord::Base.respond_to?(:use_yaml_unsafe_load)
ActiveRecord::Base.use_yaml_unsafe_load = true
end

if ENV['AR_VERSION'].to_f >= 6.0
yaml_config = if Gem::Version.new(Psych::VERSION) >= Gem::Version.new('3.2.1')
YAML.safe_load_file(test_dir.join("database.yml"), aliases: true)[adapter]
Expand Down

0 comments on commit 612c874

Please sign in to comment.