2017-12-10 23:05:11 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-27 18:32:52 -04:00
|
|
|
require File.expand_path("boot", __dir__)
|
2011-02-08 12:16:35 -05:00
|
|
|
|
2021-03-18 01:18:32 -04:00
|
|
|
# Here a conventional app would load the Rails components it needs, but we have
|
|
|
|
# already loaded these in our spec_helper.
|
|
|
|
# require "active_record/railtie"
|
|
|
|
# require "action_controller/railtie"
|
2011-02-08 12:16:35 -05:00
|
|
|
|
2021-03-18 01:18:32 -04:00
|
|
|
# Here a conventional app would require gems, but again, we have already loaded
|
|
|
|
# these in our spec_helper.
|
|
|
|
# Bundler.require(:default, Rails.env)
|
2011-02-08 12:16:35 -05:00
|
|
|
|
|
|
|
module Dummy
|
|
|
|
class Application < Rails::Application
|
2022-08-24 23:21:52 -04:00
|
|
|
YAML_COLUMN_PERMITTED_CLASSES = [
|
|
|
|
::ActiveRecord::Type::Time::Value,
|
|
|
|
::ActiveSupport::TimeWithZone,
|
|
|
|
::ActiveSupport::TimeZone,
|
|
|
|
::BigDecimal,
|
|
|
|
::Date,
|
|
|
|
::Symbol,
|
|
|
|
::Time
|
|
|
|
].freeze
|
|
|
|
|
|
|
|
config.load_defaults(::ActiveRecord.gem_version.segments.take(2).join("."))
|
2020-12-14 15:49:48 -05:00
|
|
|
|
2011-02-08 12:16:35 -05:00
|
|
|
config.encoding = "utf-8"
|
|
|
|
config.filter_parameters += [:password]
|
2013-02-07 15:15:25 -05:00
|
|
|
config.active_support.escape_html_entities_in_json = true
|
2017-03-31 22:33:12 -04:00
|
|
|
config.active_support.test_order = :sorted
|
2016-03-05 17:07:32 -05:00
|
|
|
config.secret_key_base = "A fox regularly kicked the screaming pile of biscuits."
|
2018-06-07 13:32:30 -04:00
|
|
|
|
2022-10-16 01:36:39 -04:00
|
|
|
# `use_yaml_unsafe_load` was added in 5.2.8.1, 6.0.5.1, 6.1.6.1, and 7.0.3.1.
|
|
|
|
# Will be removed in 7.1.0?
|
|
|
|
if ::ActiveRecord.respond_to?(:use_yaml_unsafe_load) # 7.0.3.1
|
2022-07-27 02:46:30 -04:00
|
|
|
::ActiveRecord.use_yaml_unsafe_load = false
|
2022-08-24 23:21:52 -04:00
|
|
|
::ActiveRecord.yaml_column_permitted_classes = YAML_COLUMN_PERMITTED_CLASSES
|
2022-10-16 01:36:39 -04:00
|
|
|
elsif ::ActiveRecord::Base.respond_to?(:use_yaml_unsafe_load) # 5.2.8.1, 6.0.5.1, 6.1.6.1
|
2022-08-24 23:21:52 -04:00
|
|
|
::ActiveRecord::Base.use_yaml_unsafe_load = false
|
|
|
|
::ActiveRecord::Base.yaml_column_permitted_classes = YAML_COLUMN_PERMITTED_CLASSES
|
2022-07-27 02:46:30 -04:00
|
|
|
end
|
2011-02-08 12:16:35 -05:00
|
|
|
end
|
|
|
|
end
|