Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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/active_record_basics.md
View
2  guides/source/active_record_basics.md
@@ -319,7 +319,7 @@ A quick example to illustrate:
```ruby
class User < ActiveRecord::Base
- validates_presence_of :name
+ validates :name, presence: true
end
User.create # => false

3 comments on commit 9d62ebb

@rafaelfranca

It is not deprecated

@szines

You're right. It is still exist, but this old version is not really explained in Active Record Validations page (http://edgeguides.rubyonrails.org/active_record_validations.html). 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.