Enable some more cops
This commit is contained in:
parent
7489b8d1aa
commit
da3d9d403a
3 changed files with 20 additions and 27 deletions
26
.rubocop.yml
26
.rubocop.yml
|
@ -289,43 +289,43 @@ Lint/BooleanSymbol:
|
|||
Enabled: true
|
||||
|
||||
Lint/CircularArgumentReference:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Lint/Debugger:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Lint/DeprecatedClassMethods:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Lint/DuplicateCaseCondition:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Lint/DuplicateMethods:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Lint/DuplicatedKey:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Lint/EachWithObjectArgument:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Lint/ElseLayout:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Lint/EmptyEnsure:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Lint/EmptyExpression:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Lint/EmptyInterpolation:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Lint/EmptyWhen:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Lint/EndInMethod:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Lint/EnsureReturn:
|
||||
Enabled: false
|
||||
|
|
|
@ -31,19 +31,12 @@ class Commentaire < ActiveRecord::Base
|
|||
dossier_user_email = dossier.user.email
|
||||
invited_users_emails = dossier.invites_user.pluck(:email).to_a
|
||||
|
||||
case email
|
||||
when I18n.t("dynamics.contact_email")
|
||||
# The commentaire is a copy of an automated notification email
|
||||
# we sent to a user, so do nothing
|
||||
|
||||
when dossier_user_email, *invited_users_emails
|
||||
# A user or an inved user posted a commentaire,
|
||||
# do nothing, the notification system will properly
|
||||
|
||||
else
|
||||
# A gestionnaire posted a commentaire,
|
||||
# we need to notify the user
|
||||
|
||||
# - If the email is the contact email, the commentaire is a copy
|
||||
# of an automated notification email we sent to a user, so do nothing.
|
||||
# - If a user or an invited user posted a commentaire, do nothing,
|
||||
# the notification system will properly
|
||||
# - Otherwise, a gestionnaire posted a commentaire, we need to notify the user
|
||||
if !email.in?([I18n.t("dynamics.contact_email"), dossier_user_email, *invited_users_emails])
|
||||
notify_user
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,7 +14,7 @@ class StagingAuthService
|
|||
end
|
||||
|
||||
def self.config
|
||||
if File.exists?(CONFIG_PATH)
|
||||
if File.exist?(CONFIG_PATH)
|
||||
YAML.safe_load(File.read(CONFIG_PATH)).symbolize_keys
|
||||
else
|
||||
{}
|
||||
|
|
Loading…
Reference in a new issue