1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Change 'validates_presence_of' to 'presence: true'

Of course validates_presence_of is still working but it is not explained in the guide, I think consequently should use 'presence: true' in this documentation.
This commit is contained in:
Zoltan Debre 2013-04-16 00:56:12 +02:00
parent 1655f4142e
commit ffde34d510

View file

@ -434,7 +434,7 @@ end
Note that the default error messages are plural (e.g., "is too short (minimum Note that the default error messages are plural (e.g., "is too short (minimum
is %{count} characters)"). For this reason, when `:minimum` is 1 you should is %{count} characters)"). For this reason, when `:minimum` is 1 you should
provide a personalized message or use `validates_presence_of` instead. When provide a personalized message or use `presence: true` instead. When
`:in` or `:within` have a lower limit of 1, you should either provide a `:in` or `:within` have a lower limit of 1, you should either provide a
personalized message or call `presence` prior to `length`. personalized message or call `presence` prior to `length`.