Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit 5d855fc

Browse files
Fix indentation
1 parent cb005cd commit 5d855fc

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

app/validators/email_validator.rb

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,36 @@ def validate_each(record, attribute, value)
99

1010
private
1111

12-
def email_invalid_error_message
13-
# options[:message] || I18n.t('errors.messages.email')
14-
(options[:message] || "must be a valid email address")
15-
end
12+
def email_invalid_error_message
13+
# options[:message] || I18n.t('errors.messages.email')
14+
(options[:message] || "must be a valid email address")
15+
end
1616

17-
def email_contains_dots_error_message
18-
(options[:message] || "must contain fewer dots")
19-
end
17+
def email_contains_dots_error_message
18+
(options[:message] || "must contain fewer dots")
19+
end
2020

21-
def email_ends_with_dot_error_message
22-
(options[:message] || "must not end with a dot")
23-
end
21+
def email_ends_with_dot_error_message
22+
(options[:message] || "must not end with a dot")
23+
end
2424

25-
def email_valid?(email_address)
26-
return true if email_address.blank?
25+
def email_valid?(email_address)
26+
return true if email_address.blank?
2727

28-
email_address =~ /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
29-
end
28+
email_address =~ /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
29+
end
3030

31-
def handle_contains_number_of_dots(email_address)
32-
return true if email_address.blank?
31+
def handle_contains_number_of_dots(email_address)
32+
return true if email_address.blank?
3333

34-
email_handle = email_address.split('@')
35-
email_handle[0].count('.') < 3 if (email_handle && !email_handle.blank?)
36-
end
34+
email_handle = email_address.split('@')
35+
email_handle[0].count('.') < 3 if (email_handle && !email_handle.blank?)
36+
end
3737

38-
def handle_last_character_is_not_dot(email_address)
39-
return true if email_address.blank?
38+
def handle_last_character_is_not_dot(email_address)
39+
return true if email_address.blank?
4040

41-
email_handle = email_address.split('@')
42-
email_handle[0][-1] != "." if (email_handle && !email_handle.blank?)
43-
end
41+
email_handle = email_address.split('@')
42+
email_handle[0][-1] != "." if (email_handle && !email_handle.blank?)
43+
end
4444
end

0 commit comments

Comments
 (0)