From 2438a1cf4ed85552d11b0ac66ef6adacde08f281 Mon Sep 17 00:00:00 2001 From: Akshat Sharma Date: Tue, 1 Sep 2015 10:42:51 +0530 Subject: Add case_sensitive option for confirmation validation Case :- 1. In case of email confirmation one needs case insensitive comparison 2. In case of password confirmation one needs case sensitive comparison [ci skip] Update Guides for case_sensitive option in confirmation validation --- guides/source/active_record_validations.md | 10 ++++++++++ 1 file changed, 10 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 1c1b863fe9..83eee4e0f4 100644 --- a/guides/source/active_record_validations.md +++ b/guides/source/active_record_validations.md @@ -327,6 +327,16 @@ class Person < ActiveRecord::Base end ``` +There is also a `:case_sensitive` option that you can use to define whether the +confirmation constraint will be case sensitive or not. This option defaults to +true. + +```ruby +class Person < ActiveRecord::Base + validates :email, confirmation: { case_sensitive: false } +end +``` + The default error message for this helper is _"doesn't match confirmation"_. ### `exclusion` -- cgit v1.2.3