Use parentheses

This commit is contained in:
gregoirenovel 2018-12-18 21:29:31 +01:00
parent 9914ebdfe4
commit 026fd1aaa2
4 changed files with 4 additions and 4 deletions

View file

@ -61,7 +61,7 @@ class Admin::GestionnairesController < AdminController
end end
def assign_gestionnaire! def assign_gestionnaire!
if current_administrateur.gestionnaires.include? @gestionnaire if current_administrateur.gestionnaires.include?(@gestionnaire)
flash.alert = 'Instructeur déjà ajouté' flash.alert = 'Instructeur déjà ajouté'
else else
@gestionnaire.administrateurs.push current_administrateur @gestionnaire.administrateurs.push current_administrateur

View file

@ -41,7 +41,7 @@ class FileSizeValidator < ActiveModel::EachValidator
end end
def validate_each(record, attribute, value) def validate_each(record, attribute, value)
if !value.kind_of? CarrierWave::Uploader::Base if !value.kind_of?(CarrierWave::Uploader::Base)
raise(ArgumentError, "A CarrierWave::Uploader::Base object was expected") raise(ArgumentError, "A CarrierWave::Uploader::Base object was expected")
end end

View file

@ -4,7 +4,7 @@ class ClamavService
return true return true
end end
FileUtils.chmod 0666, file_path FileUtils.chmod(0666, file_path)
client = ClamAV::Client.new client = ClamAV::Client.new
response = client.execute(ClamAV::Commands::ScanCommand.new(file_path)) response = client.execute(ClamAV::Commands::ScanCommand.new(file_path))

View file

@ -17,7 +17,7 @@ class PiecesJustificativesService
def self.upload_one!(dossier, user, params) def self.upload_one!(dossier, user, params)
content = params[:piece_justificative][:content] content = params[:piece_justificative][:content]
if ClamavService.safe_file? content.path if ClamavService.safe_file?(content.path)
pj = PieceJustificative.new(content: content, pj = PieceJustificative.new(content: content,
dossier: dossier, dossier: dossier,
type_de_piece_justificative: nil, type_de_piece_justificative: nil,