Enable some more cops

This commit is contained in:
gregoirenovel 2018-03-06 12:03:32 +01:00
parent 7489b8d1aa
commit da3d9d403a
3 changed files with 20 additions and 27 deletions

View file

@ -289,43 +289,43 @@ Lint/BooleanSymbol:
Enabled: true Enabled: true
Lint/CircularArgumentReference: Lint/CircularArgumentReference:
Enabled: false Enabled: true
Lint/Debugger: Lint/Debugger:
Enabled: false Enabled: true
Lint/DeprecatedClassMethods: Lint/DeprecatedClassMethods:
Enabled: false Enabled: true
Lint/DuplicateCaseCondition: Lint/DuplicateCaseCondition:
Enabled: false Enabled: true
Lint/DuplicateMethods: Lint/DuplicateMethods:
Enabled: false Enabled: true
Lint/DuplicatedKey: Lint/DuplicatedKey:
Enabled: false Enabled: true
Lint/EachWithObjectArgument: Lint/EachWithObjectArgument:
Enabled: false Enabled: true
Lint/ElseLayout: Lint/ElseLayout:
Enabled: false Enabled: true
Lint/EmptyEnsure: Lint/EmptyEnsure:
Enabled: false Enabled: true
Lint/EmptyExpression: Lint/EmptyExpression:
Enabled: false Enabled: true
Lint/EmptyInterpolation: Lint/EmptyInterpolation:
Enabled: false Enabled: true
Lint/EmptyWhen: Lint/EmptyWhen:
Enabled: false Enabled: true
Lint/EndInMethod: Lint/EndInMethod:
Enabled: false Enabled: true
Lint/EnsureReturn: Lint/EnsureReturn:
Enabled: false Enabled: false

View file

@ -31,19 +31,12 @@ class Commentaire < ActiveRecord::Base
dossier_user_email = dossier.user.email dossier_user_email = dossier.user.email
invited_users_emails = dossier.invites_user.pluck(:email).to_a invited_users_emails = dossier.invites_user.pluck(:email).to_a
case email # - If the email is the contact email, the commentaire is a copy
when I18n.t("dynamics.contact_email") # of an automated notification email we sent to a user, so do nothing.
# The commentaire is a copy of an automated notification email # - If a user or an invited user posted a commentaire, do nothing,
# we sent to a user, so do nothing # the notification system will properly
# - Otherwise, a gestionnaire posted a commentaire, we need to notify the user
when dossier_user_email, *invited_users_emails if !email.in?([I18n.t("dynamics.contact_email"), 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
notify_user notify_user
end end
end end

View file

@ -14,7 +14,7 @@ class StagingAuthService
end end
def self.config def self.config
if File.exists?(CONFIG_PATH) if File.exist?(CONFIG_PATH)
YAML.safe_load(File.read(CONFIG_PATH)).symbolize_keys YAML.safe_load(File.read(CONFIG_PATH)).symbolize_keys
else else
{} {}