Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Change deprecated validates_presence_of

In Validations section the example contained "validates_presence_of" which is deprecated. It should be "validates :name, presence: true"
  • Loading branch information...
commit 9d62ebb0d025150aa685845bb482deeafc65af9c 1 parent 3bacdde
@szines szines authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  guides/source/
2  guides/source/
@@ -319,7 +319,7 @@ A quick example to illustrate:
class User < ActiveRecord::Base
- validates_presence_of :name
+ validates :name, presence: true
User.create # => false

3 comments on commit 9d62ebb


It is not deprecated


You're right. It is still exist, but this old version is not really explained in Active Record Validations page ( I thought, would be more consistent with the new version of validation.

Please sign in to comment.
Something went wrong with that request. Please try again.