Enable Style/SymbolProc

This commit is contained in:
gregoirenovel 2018-10-01 14:20:14 +02:00
parent 7e4268db67
commit d9d4f6fe20
16 changed files with 17 additions and 26 deletions

View file

@ -2,7 +2,7 @@ require Rails.root.join("lib", "tasks", "task_helper")
namespace :'2018_01_18_clean_datetime_in_champs' do
task clean: :environment do
datetime_champs = TypeDeChamp.where(type_champ: "datetime").flat_map{ |t| t.champ }
datetime_champs = TypeDeChamp.where(type_champ: "datetime").flat_map(&:champ)
# Match " HH:MM" => nil a datetime is not valid if not composed by date AND time
datetime_champs.select { |c| /^\s\d{2}:\d{2}$/.match(c.value) }.each do |c|

View file

@ -1,7 +1,5 @@
namespace :'2018_06_04_scan_pjs' do
task scan_all: :environment do
Champs::PieceJustificativeChamp.all.each do |pj_champ|
pj_champ.create_virus_scan
end
Champs::PieceJustificativeChamp.all.each(&:create_virus_scan)
end
end

View file

@ -3,7 +3,7 @@ require Rails.root.join("lib", "tasks", "task_helper")
namespace :'2018_06_06_users_for_admins_and_gestionnaires' do
task preactivate: :environment do
preactivate_users(Gestionnaire, 'accompagnateur') { |g| g.reset_password_token.nil? }
preactivate_users(Administrateur) { |a| a.active? }
preactivate_users(Administrateur, &:active?)
end
def preactivate_users(model, role_name = nil, &block)

View file

@ -45,7 +45,7 @@ namespace :support do
if user.dossiers.state_instruction_commencee.any?
fail "Cannot delete this user because instruction has started for some dossiers"
end
user.dossiers.each { |d| d.delete_and_keep_track }
user.dossiers.each(&:delete_and_keep_track)
user.destroy
end
end