aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-19 02:49:00 -0800
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-19 02:49:00 -0800
commitea0056f52ab8e15668326458077a3f88825d2a30 (patch)
treed7d34378ebdd1ac33d0aaaccc7bb4f629daf91ed /activemodel
parent12d32ddea2ad6420456ca3f9128023519ef08799 (diff)
parentc33e893775e1c775412553275d4c3cd16ca03d96 (diff)
downloadrails-ea0056f52ab8e15668326458077a3f88825d2a30.tar.gz
rails-ea0056f52ab8e15668326458077a3f88825d2a30.tar.bz2
rails-ea0056f52ab8e15668326458077a3f88825d2a30.zip
Merge pull request #8256 from nalwayaabhishek/master
Displaying error message if validation fail in examples (p tag was missing)
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/examples/validations.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activemodel/examples/validations.rb b/activemodel/examples/validations.rb
index 0b2706076f..a56ec4db39 100644
--- a/activemodel/examples/validations.rb
+++ b/activemodel/examples/validations.rb
@@ -22,8 +22,8 @@ class Person
end
person1 = Person.new
-p person1.valid?
-person1.errors
+p person1.valid? # => false
+p person1.errors.messages # => {:name=>["can't be blank"]}
person2 = Person.new(:name => "matz")
-p person2.valid?
+p person2.valid? # => true