aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/translation.rb
diff options
context:
space:
mode:
authorGonçalo Silva <goncalossilva@gmail.com>2011-03-24 17:21:17 +0000
committerGonçalo Silva <goncalossilva@gmail.com>2011-03-24 17:21:17 +0000
commit9887f238871bb2dd73de6ce8855615bcc5d8d079 (patch)
tree74fa9ff9524a51701cfa23f708b3f777c65b7fe5 /activemodel/lib/active_model/translation.rb
parentaff821508a16245ebc03510ba29c70379718dfb7 (diff)
parent5214e73850916de3c9127d35a4ecee0424d364a3 (diff)
downloadrails-9887f238871bb2dd73de6ce8855615bcc5d8d079.tar.gz
rails-9887f238871bb2dd73de6ce8855615bcc5d8d079.tar.bz2
rails-9887f238871bb2dd73de6ce8855615bcc5d8d079.zip
Merge branch 'master' of https://github.com/rails/rails
Diffstat (limited to 'activemodel/lib/active_model/translation.rb')
-rw-r--r--activemodel/lib/active_model/translation.rb20
1 files changed, 7 insertions, 13 deletions
diff --git a/activemodel/lib/active_model/translation.rb b/activemodel/lib/active_model/translation.rb
index 0facbd6ce1..dbb76244e4 100644
--- a/activemodel/lib/active_model/translation.rb
+++ b/activemodel/lib/active_model/translation.rb
@@ -3,19 +3,19 @@ require 'active_support/core_ext/hash/reverse_merge'
module ActiveModel
# == Active Model Translation
- #
+ #
# Provides integration between your object and the Rails internationalization
# (i18n) framework.
- #
+ #
# A minimal implementation could be:
- #
+ #
# class TranslatedPerson
# extend ActiveModel::Translation
# end
- #
+ #
# TranslatedPerson.human_attribute_name('my_attribute')
# # => "My attribute"
- #
+ #
# This also provides the required class methods for hooking into the
# Rails internationalization API, including being able to define a
# class based i18n_scope and lookup_ancestors to find translations in
@@ -28,9 +28,9 @@ module ActiveModel
:activemodel
end
- # When localizing a string, it goes through the lookup returned by this
+ # When localizing a string, it goes through the lookup returned by this
# method, which is used in ActiveModel::Name#human,
- # ActiveModel::Errors#full_messages and
+ # ActiveModel::Errors#full_messages and
# ActiveModel::Translation#human_attribute_name.
def lookup_ancestors
self.ancestors.select { |x| x.respond_to?(:model_name) }
@@ -54,11 +54,5 @@ module ActiveModel
options.reverse_merge! :count => 1, :default => defaults
I18n.translate(defaults.shift, options)
end
-
- # Model.human_name is deprecated. Use Model.model_name.human instead.
- def human_name(*args)
- ActiveSupport::Deprecation.warn("human_name has been deprecated, please use model_name.human instead", caller[0,5])
- model_name.human(*args)
- end
end
end