aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/README.rdoc
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-02-09 23:44:17 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2012-02-09 23:44:17 +0530
commite6c98b83cbf4eab8944601754cc8d0e627b55d6f (patch)
treedfab846ff415e071f9368d9d5fa1036d2c8cb1c6 /activemodel/README.rdoc
parenta8c150e0df0cba1cd766e6fe3828926d9f3eb7f3 (diff)
parentb0a39d9feb412777e4f3a0199f07713ef4e343c9 (diff)
downloadrails-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/README.rdoc')
-rw-r--r--activemodel/README.rdoc7
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