aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-12-20 20:13:34 +0100
committerXavier Noria <fxn@hashref.com>2010-12-20 20:13:34 +0100
commit880f8419c41db0aea4b7cf3abd74fe5d32fa04a7 (patch)
tree0c21b8e0829136b6fb33a136caf3085f2a78c857 /activemodel
parent0cbfd6c28d327304432f7d0c067662b5c1e41a78 (diff)
parent6909fb6cff49e11574909b55864af8673d044eb7 (diff)
downloadrails-880f8419c41db0aea4b7cf3abd74fe5d32fa04a7.tar.gz
rails-880f8419c41db0aea4b7cf3abd74fe5d32fa04a7.tar.bz2
rails-880f8419c41db0aea4b7cf3abd74fe5d32fa04a7.zip
Merge branch 'master' of git://github.com/lifo/docrails
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/README.rdoc6
-rw-r--r--activemodel/lib/active_model/serialization.rb4
2 files changed, 5 insertions, 5 deletions
diff --git a/activemodel/README.rdoc b/activemodel/README.rdoc
index 9b96bfaba7..f3d4bf8fe3 100644
--- a/activemodel/README.rdoc
+++ b/activemodel/README.rdoc
@@ -84,7 +84,7 @@ modules:
attr_reader :errors
def validate!
- errors.add(:name, "can not be nil") if name == nil
+ errors.add(:name, "can not be nil") if name.nil?
end
def ErrorsPerson.human_attribute_name(attr, options = {})
@@ -94,10 +94,10 @@ modules:
end
person.errors.full_messages
- # => ["Name Can not be nil"]
+ # => ["Name can not be nil"]
person.errors.full_messages
- # => ["Name Can not be nil"]
+ # => ["Name can not be nil"]
{Learn more}[link:classes/ActiveModel/Errors.html]
diff --git a/activemodel/lib/active_model/serialization.rb b/activemodel/lib/active_model/serialization.rb
index 37739b98a1..f659419293 100644
--- a/activemodel/lib/active_model/serialization.rb
+++ b/activemodel/lib/active_model/serialization.rb
@@ -15,7 +15,7 @@ module ActiveModel
# attr_accessor :name
#
# def attributes
- # @attributes ||= {'name' => 'nil'}
+ # @attributes ||= {'name' => nil}
# end
#
# end
@@ -45,7 +45,7 @@ module ActiveModel
# attr_accessor :name
#
# def attributes
- # @attributes ||= {'name' => 'nil'}
+ # @attributes ||= {'name' => nil}
# end
#
# end