aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/CHANGELOG.md
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-03-30 14:38:12 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-03-30 14:38:13 -0300
commit3d0c0c6c95f8ed35c3fea79cfe93ec6e74f726ec (patch)
tree23d3f94111ee9f5d0c3ecc4d4f10b8390051f4cc /activemodel/CHANGELOG.md
parent7860bf11d862a6eb1bd9ada85bcd97f17a2cb536 (diff)
downloadrails-3d0c0c6c95f8ed35c3fea79cfe93ec6e74f726ec.tar.gz
rails-3d0c0c6c95f8ed35c3fea79cfe93ec6e74f726ec.tar.bz2
rails-3d0c0c6c95f8ed35c3fea79cfe93ec6e74f726ec.zip
Improve changelog entry for ActiveModel::Errors#full_messages_for [ci skip]
Add a working example of how to use this new method.
Diffstat (limited to 'activemodel/CHANGELOG.md')
-rw-r--r--activemodel/CHANGELOG.md15
1 files changed, 13 insertions, 2 deletions
diff --git a/activemodel/CHANGELOG.md b/activemodel/CHANGELOG.md
index e4c80b1bf8..9aee47bd52 100644
--- a/activemodel/CHANGELOG.md
+++ b/activemodel/CHANGELOG.md
@@ -1,7 +1,18 @@
## Rails 4.0.0 (unreleased) ##
-* Add ActiveModel::Errors#full_messages_for, a method that returns all the error
- messages for a given attribute.
+* Add `ActiveModel::Errors#full_messages_for`, to return all the error messages
+ for a given attribute.
+
+ class Person
+ include ActiveModel::Validations
+
+ attr_reader :name, :email
+ validates_presence_of :name, :email
+ end
+
+ person = Person.new
+ person.valid? # => false
+ person.errors.full_messages_for(:name) # => ["Name can't be blank"]
*Volodymyr Shatsky*