lib/fishplate.rb in fishplate-7.0.1 vs lib/fishplate.rb in fishplate-7.0.2
- old
+ new
@@ -21,10 +21,17 @@
Kernel.load File.expand_path('fishplate/tasks.rake', __dir__)
A9n.root.join('lib/tasks').glob('**/*.rake').sort.each { |f| Kernel.load f }
end
def database_configuration
- @database_configuration ||= YAML.load(ERB.new(A9n.root.join('config/database.yml').read).result) # rubocop:disable Security/YAMLLoad
+ @database_configuration ||= begin
+ content = ERB.new(A9n.root.join('config/database.yml').read).result
+ if RUBY_VERSION >= '3.1'
+ YAML.load(content, aliases: true)
+ else
+ YAML.load(content)
+ end
+ end
end
def time_zone=(value)
TZInfo::DataSource.get
Time.find_zone!(value).tap do |zone|