aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/CHANGELOG.md
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-04-12 15:48:19 +0200
committerYves Senn <yves.senn@gmail.com>2013-04-12 15:52:43 +0200
commitc245437de7ec1a4b9ee8068751ac5bbd0e9d5881 (patch)
tree5fc222d163b985232dbe9cf93bdd49d00918ef03 /activemodel/CHANGELOG.md
parent481618cfc20faf980e0e238ffa1a9d192b51d00b (diff)
downloadrails-c245437de7ec1a4b9ee8068751ac5bbd0e9d5881.tar.gz
rails-c245437de7ec1a4b9ee8068751ac5bbd0e9d5881.tar.bz2
rails-c245437de7ec1a4b9ee8068751ac5bbd0e9d5881.zip
use unified and clean formatting in CHANGELOGS. [ci skip]
Diffstat (limited to 'activemodel/CHANGELOG.md')
-rw-r--r--activemodel/CHANGELOG.md21
1 files changed, 12 insertions, 9 deletions
diff --git a/activemodel/CHANGELOG.md b/activemodel/CHANGELOG.md
index 9aee47bd52..a1f3d081db 100644
--- a/activemodel/CHANGELOG.md
+++ b/activemodel/CHANGELOG.md
@@ -3,6 +3,8 @@
* Add `ActiveModel::Errors#full_messages_for`, to return all the error messages
for a given attribute.
+ Example:
+
class Person
include ActiveModel::Validations
@@ -19,26 +21,27 @@
* Added a method so that validations can be easily cleared on a model.
For example:
- class Person
- include ActiveModel::Validations
+ class Person
+ include ActiveModel::Validations
- validates_uniqueness_of :first_name
- validate :cannot_be_robot
+ validates_uniqueness_of :first_name
+ validate :cannot_be_robot
- def cannot_be_robot
- errors.add(:base, 'A person cannot be a robot') if person_is_robot
+ def cannot_be_robot
+ errors.add(:base, 'A person cannot be a robot') if person_is_robot
+ end
end
- end
Now, if someone runs `Person.clear_validators!`, then the following occurs:
- Person.validators # => []
- Person._validate_callbacks.empty? # => true
+ Person.validators # => []
+ Person._validate_callbacks.empty? # => true
*John Wang*
* `has_secure_password` does not fail the confirmation validation
when assigning empty String to `password` and `password_confirmation`.
+ Fixes #9535.
Example: