diff options
author | Sven Fuchs <svenfuchs@artweb-design.de> | 2008-07-02 19:21:07 +0200 |
---|---|---|
committer | Sven Fuchs <svenfuchs@artweb-design.de> | 2008-07-02 19:21:07 +0200 |
commit | 8f74ba96c47e77e18ce363c8e7cd2fc9196faf7a (patch) | |
tree | d3ea17f604e93db745ee74ee21dc7cafa76bc81d /activerecord/lib/active_record | |
parent | 7403c825a05af320e20f1b7e20b0c565081ede89 (diff) | |
download | rails-8f74ba96c47e77e18ce363c8e7cd2fc9196faf7a.tar.gz rails-8f74ba96c47e77e18ce363c8e7cd2fc9196faf7a.tar.bz2 rails-8f74ba96c47e77e18ce363c8e7cd2fc9196faf7a.zip |
remove core extensions in favor of I18n#translate and I18n#localize
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-x | activerecord/lib/active_record/validations.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 5bbd10394c..5245f65869 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -22,7 +22,7 @@ module ActiveRecord class << self def default_error_messages ActiveSupport::Deprecation.warn("ActiveRecord::Errors.default_error_messages has been deprecated. Please use 'active_record.error_messages'.t.") - 'active_record.error_messages'.t + I18n.translate 'active_record.error_messages' end end @@ -43,7 +43,7 @@ module ActiveRecord # error can be added to the same +attribute+ in which case an array will be returned on a call to <tt>on(attribute)</tt>. # If no +msg+ is supplied, "invalid" is assumed. def add(attribute, message = nil) - message ||= :"active_record.error_messages.invalid".t + message ||= I18n.translate :"active_record.error_messages.invalid" @errors[attribute.to_s] ||= [] @errors[attribute.to_s] << message end @@ -168,7 +168,7 @@ module ActiveRecord full_messages << message else key = :"active_record.human_attribute_names.#{@base.class.name.underscore.to_sym}.#{attr}" - attr_name = key.t(locale) || @base.class.human_attribute_name(attr) + attr_name = I18n.translate(key, locale, :raise => true) rescue @base.class.human_attribute_name(attr) full_messages << attr_name + " " + message end end |