1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00
paper-trail-gem--paper_trail/spec/dummy_app/config/application.rb

47 lines
1.7 KiB
Ruby
Raw Normal View History

2017-12-10 23:05:11 -05:00
# frozen_string_literal: true
require File.expand_path("../boot", __FILE__)
2011-02-08 12:16:35 -05: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)
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]
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
config.secret_key_base = "A fox regularly kicked the screaming pile of biscuits."
# `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
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"
config.active_record.time_zone_aware_types = [:datetime]
end
end
2011-02-08 12:16:35 -05:00
end
end