Simplify some code

This commit is contained in:
gregoirenovel 2018-12-18 21:30:08 +01:00
parent 81ee1c2961
commit 3ce3d203d4
2 changed files with 2 additions and 6 deletions

View file

@ -31,7 +31,7 @@ class User < ApplicationRecord
def self.find_for_france_connect(email, siret)
user = User.find_by(email: email)
if user.nil?
return User.create(email: email, password: Devise.friendly_token[0, 20], siret: siret)
User.create(email: email, password: Devise.friendly_token[0, 20], siret: siret)
else
user.update(siret: siret)
user

View file

@ -9,10 +9,6 @@ class ClamavService
client = ClamAV::Client.new
response = client.execute(ClamAV::Commands::ScanCommand.new(file_path))
if response.first.class == ClamAV::VirusResponse
return false
end
true
response.first.class != ClamAV::VirusResponse
end
end