From ffde34d51075e584658b5d492a9d2b101c5633b7 Mon Sep 17 00:00:00 2001 From: Zoltan Debre Date: Tue, 16 Apr 2013 00:56:12 +0200 Subject: 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. --- guides/source/active_record_validations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/active_record_validations.md') diff --git a/guides/source/active_record_validations.md b/guides/source/active_record_validations.md index df39d3c5dc..d043e42090 100644 --- a/guides/source/active_record_validations.md +++ b/guides/source/active_record_validations.md @@ -434,7 +434,7 @@ end 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 -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 personalized message or call `presence` prior to `length`. -- cgit v1.2.3 From 9616849ccb52b517614fcd964c0f074e16a805c9 Mon Sep 17 00:00:00 2001 From: aditya-kapoor Date: Mon, 22 Apr 2013 15:21:10 +0530 Subject: corrected a line related to on: :save option in validations --- guides/source/active_record_validations.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'guides/source/active_record_validations.md') diff --git a/guides/source/active_record_validations.md b/guides/source/active_record_validations.md index d043e42090..c279ef0a4a 100644 --- a/guides/source/active_record_validations.md +++ b/guides/source/active_record_validations.md @@ -765,6 +765,8 @@ class Person < ActiveRecord::Base validates :age, numericality: true, on: :update # the default (validates on both create and update) + The following line is in review state and as of now, it is not running in any version of Rails 3.2.x as discussed in this [issue](https://github.com/rails/rails/issues/10248) + validates :name, presence: true, on: :save end ``` -- cgit v1.2.3 From d2a799895b19cabca86a209cf2dac0dc5215ab48 Mon Sep 17 00:00:00 2001 From: aditya-kapoor Date: Mon, 22 Apr 2013 15:26:29 +0530 Subject: corrected a typo related to on: :save option in validations --- guides/source/active_record_validations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/active_record_validations.md') diff --git a/guides/source/active_record_validations.md b/guides/source/active_record_validations.md index c279ef0a4a..842779e0ea 100644 --- a/guides/source/active_record_validations.md +++ b/guides/source/active_record_validations.md @@ -765,7 +765,7 @@ class Person < ActiveRecord::Base validates :age, numericality: true, on: :update # the default (validates on both create and update) - The following line is in review state and as of now, it is not running in any version of Rails 3.2.x as discussed in this [issue](https://github.com/rails/rails/issues/10248) + # The following line is in review state and as of now, it is not running in any version of Rails 3.2.x as discussed in this [issue](https://github.com/rails/rails/issues/10248) validates :name, presence: true, on: :save end -- cgit v1.2.3 From 73fece000f93d811337e18f376acc6df3efed6b3 Mon Sep 17 00:00:00 2001 From: aditya-kapoor Date: Mon, 22 Apr 2013 16:16:44 +0530 Subject: Added instructions of latest bundler install + modified the on: :save option description in validations --- guides/source/active_record_validations.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'guides/source/active_record_validations.md') diff --git a/guides/source/active_record_validations.md b/guides/source/active_record_validations.md index 842779e0ea..dfc951f10e 100644 --- a/guides/source/active_record_validations.md +++ b/guides/source/active_record_validations.md @@ -765,11 +765,10 @@ class Person < ActiveRecord::Base validates :age, numericality: true, on: :update # the default (validates on both create and update) - # The following line is in review state and as of now, it is not running in any version of Rails 3.2.x as discussed in this [issue](https://github.com/rails/rails/issues/10248) - validates :name, presence: true, on: :save end ``` +The last line is in review state and as of now, it is not running in any version of Rails 3.2.x as discussed in this [issue](https://github.com/rails/rails/issues/10248) Strict Validations ------------------ -- cgit v1.2.3