aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/validations.rb
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-06-22 12:42:32 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-06-22 12:42:32 -0500
commit629bc03bf885f8d1450a28972c5bea630a079e85 (patch)
tree3d9a4535629711a0041c010e05ac063e89f7e23d /activerecord/lib/active_record/validations.rb
parent35ee8fa3d8b3ad49179f86af2bec2e53af335ac9 (diff)
downloadrails-629bc03bf885f8d1450a28972c5bea630a079e85.tar.gz
rails-629bc03bf885f8d1450a28972c5bea630a079e85.tar.bz2
rails-629bc03bf885f8d1450a28972c5bea630a079e85.zip
change param name to improve documentation
The keys of the error messages are actually attribute names. It makes the documentation easier to understand: # Returns +true+ if the error messages include an error for the given # +attribute+, +false+ otherwise. # # person.errors.messages # => { :name => ["can not be nil"] } # person.errors.include?(:name) # => true # person.errors.include?(:age) # => false def include?(attribute) (v = messages[attribute]) && v.any? end
Diffstat (limited to 'activerecord/lib/active_record/validations.rb')
0 files changed, 0 insertions, 0 deletions