You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use humanized attribute names and grammatically correct messages so UI, API, and job error output read naturally instead of exposing awkward wording like "Notify emails to is not available."
Co-authored-by: Cursor <cursoragent@cursor.com>
errors.add(:notify_emails_to,_("is not allowed for unknown users"))ifnotify_emails_to.present?
70
+
errors.add(:notify_emails_to,_("are not allowed for unknown users"))ifnotify_emails_to.present?
59
71
errors.add(:notify_emails_to_locale,_("is not allowed for unknown users"))ifnotify_emails_to_locale.present?
60
72
61
73
return
62
74
end
63
75
64
76
unlessnotify_by_email_creator == user
65
-
errors.add(:notify_emails_to,_("is allowed for only owners"))ifnotify_emails_to.present?
77
+
errors.add(:notify_emails_to,_("are allowed for only owners"))ifnotify_emails_to.present?
66
78
errors.add(:notify_emails_to_locale,_("is allowed for only owners"))ifnotify_emails_to_locale.present?
67
79
68
80
return
69
81
end
70
82
71
83
ifnotify_by_email_creator.email_limit_reached?
72
-
errors.add(:notify_emails_to,_("is not allowed because the maximum number of emails has been reached for today"))ifnotify_emails_to.present?
73
-
errors.add(:notify_emails_to_locale,_("is not allowed because the maximum number of emails has been reached for today"))ifnotify_emails_to_locale.present?
84
+
errors.add(:base,_("The maximum number of emails has been reached for today"))
Copy file name to clipboardExpand all lines: test/unit/send_notify_by_email_job_test.rb
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ class SendNotifyByEmailJobTest < ActiveJob::TestCase
62
62
@notify_by_email.reload
63
63
assert_equal"failed",@notify_by_email.status
64
64
assert@notify_by_email.successful_sends.blank?
65
-
assert_equal"Notify emails to can't be blank.",@notify_by_email.error_message
65
+
assert_equal"Recipient emails can't be blank.",@notify_by_email.error_message
66
66
end
67
67
68
68
test"perform does not send mail when notifying by email is not available"do
@@ -72,7 +72,7 @@ class SendNotifyByEmailJobTest < ActiveJob::TestCase
72
72
73
73
@notify_by_email.reload
74
74
assert_equal"failed",@notify_by_email.status,"Status should be failed"
75
-
assert_equal"Notify emails to is not available. Notify emails to locale is not available. Notify by email feature is not enabled.",@notify_by_email.error_message
75
+
assert_equal"Recipient emails are not available. Notification language is not available. Notify by email feature is not enabled.",@notify_by_email.error_message
76
76
end
77
77
78
78
test"perform logs error and does not send mail if notify_by_email is not found"do
0 commit comments