aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/validations.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-10-12 22:15:43 -0500
committerJoshua Peek <josh@joshpeek.com>2009-10-12 22:15:43 -0500
commit21e7b8462113fc7c0fd1882dcc2bf7225de67b1a (patch)
tree81350780f50b8378aec99210d956bba3dda635f7 /activerecord/lib/active_record/validations.rb
parent9bc8defe38253840ceb9c4ad92e7c3abc0066ed8 (diff)
downloadrails-21e7b8462113fc7c0fd1882dcc2bf7225de67b1a.tar.gz
rails-21e7b8462113fc7c0fd1882dcc2bf7225de67b1a.tar.bz2
rails-21e7b8462113fc7c0fd1882dcc2bf7225de67b1a.zip
Callbacks, DeprecatedCallbacks = NewCallbacks, Callbacks
Diffstat (limited to 'activerecord/lib/active_record/validations.rb')
-rw-r--r--activerecord/lib/active_record/validations.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb
index ab79b520a2..e61b253192 100644
--- a/activerecord/lib/active_record/validations.rb
+++ b/activerecord/lib/active_record/validations.rb
@@ -59,15 +59,15 @@ module ActiveRecord
end
# Translates an error message in it's default scope (<tt>activerecord.errrors.messages</tt>).
- # Error messages are first looked up in <tt>models.MODEL.attributes.ATTRIBUTE.MESSAGE</tt>, if it's not there,
- # it's looked up in <tt>models.MODEL.MESSAGE</tt> and if that is not there it returns the translation of the
- # default message (e.g. <tt>activerecord.errors.messages.MESSAGE</tt>). The translated model name,
+ # Error messages are first looked up in <tt>models.MODEL.attributes.ATTRIBUTE.MESSAGE</tt>, if it's not there,
+ # it's looked up in <tt>models.MODEL.MESSAGE</tt> and if that is not there it returns the translation of the
+ # default message (e.g. <tt>activerecord.errors.messages.MESSAGE</tt>). The translated model name,
# translated attribute name and the value are available for interpolation.
#
# When using inheritance in your models, it will check all the inherited models too, but only if the model itself
# hasn't been found. Say you have <tt>class Admin < User; end</tt> and you wanted the translation for the <tt>:blank</tt>
# error +message+ for the <tt>title</tt> +attribute+, it looks for these translations:
- #
+ #
# <ol>
# <li><tt>activerecord.errors.models.admin.attributes.title.blank</tt></li>
# <li><tt>activerecord.errors.models.admin.blank</tt></li>
@@ -80,10 +80,10 @@ module ActiveRecord
message, options[:default] = options[:default], message if options[:default].is_a?(Symbol)
defaults = @base.class.self_and_descendants_from_active_record.map do |klass|
- [ :"models.#{klass.name.underscore}.attributes.#{attribute}.#{message}",
+ [ :"models.#{klass.name.underscore}.attributes.#{attribute}.#{message}",
:"models.#{klass.name.underscore}.#{message}" ]
end
-
+
defaults << options.delete(:default)
defaults = defaults.compact.flatten << :"messages.#{message}"
@@ -104,7 +104,7 @@ module ActiveRecord
module Validations
extend ActiveSupport::Concern
- include ActiveSupport::Callbacks
+ include ActiveSupport::DeprecatedCallbacks
include ActiveModel::Validations
included do