diff options
author | wycats <wycats@gmail.com> | 2010-06-02 15:53:10 +0200 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-06-02 15:53:10 +0200 |
commit | 26c5680bd01bd0e525eccc5d47a2e7126d9383f7 (patch) | |
tree | c655c56511ef89ba55c554a0aa7d82b1cd062f78 /activemodel | |
parent | b870daba5ff71973b237616fb95f90bb321ae7fb (diff) | |
parent | 4b91daff13be43ed913a97ffc8ad1b3f77fd9690 (diff) | |
download | rails-26c5680bd01bd0e525eccc5d47a2e7126d9383f7.tar.gz rails-26c5680bd01bd0e525eccc5d47a2e7126d9383f7.tar.bz2 rails-26c5680bd01bd0e525eccc5d47a2e7126d9383f7.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/activemodel.gemspec | 2 | ||||
-rw-r--r-- | activemodel/lib/active_model/errors.rb | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/activemodel/activemodel.gemspec b/activemodel/activemodel.gemspec index 9695911398..678007c0ef 100644 --- a/activemodel/activemodel.gemspec +++ b/activemodel/activemodel.gemspec @@ -20,4 +20,6 @@ Gem::Specification.new do |s| s.has_rdoc = true s.add_dependency('activesupport', version) + s.add_dependency('builder', '~> 2.1.2') + s.add_dependency('i18n', '~> 0.4.0') end diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index 14afc5265f..15d468f5d8 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -170,13 +170,13 @@ module ActiveModel end end - # Adds an error message (+messsage+) to the +attribute+, which will be returned on a call to <tt>on(attribute)</tt> - # for the same attribute and ensure that this error object returns false when asked if <tt>empty?</tt>. More than one - # 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 +messsage+ is supplied, :invalid is assumed. + # Adds +message+ to the error messages on +attribute+, which will be returned on a call to + # <tt>on(attribute)</tt> for the same attribute. More than one 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 +message+ is supplied, <tt>:invalid</tt> is assumed. # - # If +message+ is a Symbol, it will be translated, using the appropriate scope (see translate_error). - # If +message+ is a Proc, it will be called, allowing for things like Time.now to be used within an error + # If +message+ is a symbol, it will be translated using the appropriate scope (see +translate_error+). + # If +message+ is a proc, it will be called, allowing for things like <tt>Time.now</tt> to be used within an error. def add(attribute, message = nil, options = {}) message ||= :invalid message = generate_message(attribute, message, options) if message.is_a?(Symbol) |