2017-07-16 13:11:16 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2009-12-31 15:28:48 -05:00
|
|
|
require "active_model"
|
2012-08-01 14:54:22 -04:00
|
|
|
require "rails"
|
|
|
|
|
|
|
|
module ActiveModel
|
2012-10-21 02:26:01 -04:00
|
|
|
class Railtie < Rails::Railtie # :nodoc:
|
2012-08-01 14:54:22 -04:00
|
|
|
config.eager_load_namespaces << ActiveModel
|
2012-11-14 10:42:54 -05:00
|
|
|
|
2018-05-22 17:20:14 -04:00
|
|
|
config.active_model = ActiveSupport::OrderedOptions.new
|
|
|
|
|
2012-11-14 10:42:54 -05:00
|
|
|
initializer "active_model.secure_password" do
|
|
|
|
ActiveModel::SecurePassword.min_cost = Rails.env.test?
|
|
|
|
end
|
2018-05-22 17:20:14 -04:00
|
|
|
|
2019-03-29 12:08:48 -04:00
|
|
|
initializer "active_model.i18n_customize_full_message" do
|
|
|
|
ActiveModel::Errors.i18n_customize_full_message = config.active_model.delete(:i18n_customize_full_message) || false
|
2018-05-22 17:20:14 -04:00
|
|
|
end
|
2012-08-01 14:54:22 -04:00
|
|
|
end
|
2012-10-21 02:26:01 -04:00
|
|
|
end
|