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
|
|
|
|
2013-08-27 12:03:52 -04:00
|
|
|
# Pick the frameworks you want:
|
2011-02-08 12:16:35 -05:00
|
|
|
require "active_record/railtie"
|
|
|
|
require "action_controller/railtie"
|
|
|
|
|
2017-03-31 22:33:12 -04:00
|
|
|
Bundler.require(:default, Rails.env)
|
2016-03-05 17:07:32 -05:00
|
|
|
require "paper_trail"
|
2011-02-08 12:16:35 -05:00
|
|
|
|
|
|
|
module Dummy
|
|
|
|
class Application < Rails::Application
|
|
|
|
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
|
|
|
|
|
|
|
|
# Disable assets in rails 4.2. In rails 5, config does not respond to
|
|
|
|
# assets, probably because it was moved out of railties to some other gem,
|
|
|
|
# and we only have dev. dependencies on railties, not all of rails. When
|
|
|
|
# we drop support for rails 4.2, we can remove this whole conditional.
|
|
|
|
if config.respond_to?(:assets)
|
|
|
|
config.assets.enabled = false
|
|
|
|
end
|
2013-02-07 15:15:25 -05:00
|
|
|
|
2016-03-05 17:07:32 -05:00
|
|
|
config.secret_key_base = "A fox regularly kicked the screaming pile of biscuits."
|
2014-12-24 13:29:48 -05:00
|
|
|
|
2016-01-04 23:53:52 -05:00
|
|
|
# `raise_in_transactional_callbacks` was added in rails 4, then deprecated
|
|
|
|
# in rails 5. Oh, how fickle are the gods.
|
|
|
|
if ActiveRecord.respond_to?(:gem_version)
|
|
|
|
v = ActiveRecord.gem_version
|
|
|
|
if v >= Gem::Version.new("4.2") && v < Gem::Version.new("5.0.0.beta1")
|
|
|
|
config.active_record.raise_in_transactional_callbacks = true
|
|
|
|
end
|
2017-08-23 18:16:02 -04:00
|
|
|
if v >= Gem::Version.new("5.0.0.beta1") && v < Gem::Version.new("5.1")
|
|
|
|
config.active_record.belongs_to_required_by_default = true
|
|
|
|
config.active_record.time_zone_aware_types = [:datetime]
|
|
|
|
end
|
|
|
|
if v >= Gem::Version.new("5.1")
|
|
|
|
config.load_defaults "5.1"
|
2016-01-11 22:07:57 -05:00
|
|
|
config.active_record.time_zone_aware_types = [:datetime]
|
|
|
|
end
|
2016-01-04 23:53:52 -05:00
|
|
|
end
|
2018-06-07 13:32:30 -04:00
|
|
|
|
2020-05-03 00:54:11 -04:00
|
|
|
# In rails >= 6.0, "`.represent_boolean_as_integer=` is now always true,
|
|
|
|
# so setting this is deprecated and will be removed in Rails 6.1."
|
|
|
|
if ::ENV["DB"] == "sqlite" &&
|
|
|
|
::Gem::Requirement.new("~> 5.2").satisfied_by?(::Rails.gem_version)
|
2018-06-07 13:32:30 -04:00
|
|
|
config.active_record.sqlite3.represent_boolean_as_integer = true
|
|
|
|
end
|
2011-02-08 12:16:35 -05:00
|
|
|
end
|
|
|
|
end
|