From d8ba2f7c5670f5b2ef1486c9a3fb3e69fc514989 Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Fri, 29 Mar 2019 21:38:48 +0530 Subject: Rename `i18n_full_message` config option to `i18n_customize_full_message` - I feel `i18n_customize_full_messages` explains the meaning of the config better. - Followup of https://github.com/rails/rails/pull/32956 --- activemodel/lib/active_model/errors.rb | 6 +++--- activemodel/lib/active_model/railtie.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'activemodel/lib') diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index d7e682d406..3a692a3e64 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -63,9 +63,9 @@ module ActiveModel MESSAGE_OPTIONS = [:message] class << self - attr_accessor :i18n_full_message # :nodoc: + attr_accessor :i18n_customize_full_message # :nodoc: end - self.i18n_full_message = false + self.i18n_customize_full_message = false attr_reader :messages, :details @@ -413,7 +413,7 @@ module ActiveModel return message if attribute == :base attribute = attribute.to_s - if self.class.i18n_full_message && @base.class.respond_to?(:i18n_scope) + if self.class.i18n_customize_full_message && @base.class.respond_to?(:i18n_scope) attribute = attribute.remove(/\[\d\]/) parts = attribute.split(".") attribute_name = parts.pop diff --git a/activemodel/lib/active_model/railtie.rb b/activemodel/lib/active_model/railtie.rb index 0ed70bd473..eb7901c7e9 100644 --- a/activemodel/lib/active_model/railtie.rb +++ b/activemodel/lib/active_model/railtie.rb @@ -13,8 +13,8 @@ module ActiveModel ActiveModel::SecurePassword.min_cost = Rails.env.test? end - initializer "active_model.i18n_full_message" do - ActiveModel::Errors.i18n_full_message = config.active_model.delete(:i18n_full_message) || false + initializer "active_model.i18n_customize_full_message" do + ActiveModel::Errors.i18n_customize_full_message = config.active_model.delete(:i18n_customize_full_message) || false end end end -- cgit v1.2.3