diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2012-02-09 23:44:17 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2012-02-09 23:44:17 +0530 |
commit | e6c98b83cbf4eab8944601754cc8d0e627b55d6f (patch) | |
tree | dfab846ff415e071f9368d9d5fa1036d2c8cb1c6 /activemodel | |
parent | a8c150e0df0cba1cd766e6fe3828926d9f3eb7f3 (diff) | |
parent | b0a39d9feb412777e4f3a0199f07713ef4e343c9 (diff) | |
download | rails-e6c98b83cbf4eab8944601754cc8d0e627b55d6f.tar.gz rails-e6c98b83cbf4eab8944601754cc8d0e627b55d6f.tar.bz2 rails-e6c98b83cbf4eab8944601754cc8d0e627b55d6f.zip |
Merge branch 'master' of github.com:lifo/docrails
Conflicts:
activerecord/lib/active_record/relation/query_methods.rb
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/README.rdoc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/activemodel/README.rdoc b/activemodel/README.rdoc index 6f737d0d8b..a7ba27ba73 100644 --- a/activemodel/README.rdoc +++ b/activemodel/README.rdoc @@ -89,10 +89,9 @@ behavior out of the box: errors.add(:name, "can not be nil") if name.nil? end - def ErrorsPerson.human_attribute_name(attr, options = {}) + def self.human_attribute_name(attr, options = {}) "Name" end - end person.errors.full_messages @@ -165,7 +164,7 @@ behavior out of the box: * Custom validators - class Person + class ValidatorPerson include ActiveModel::Validations validates_with HasNameValidator attr_accessor :name @@ -173,7 +172,7 @@ behavior out of the box: class HasNameValidator < ActiveModel::Validator def validate(record) - record.errors[:name] = "must exist" if record.name.blank? + record.errors[:name] = "must exist" if record.name.blank? end end |