From 3e56d44f50c74a07b0591631adf3c98c2d485038 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Thu, 22 Oct 2015 22:20:11 -0300 Subject: [PATCH] use group controle --- script/process_merit_rules.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/script/process_merit_rules.rb b/script/process_merit_rules.rb index 70fda9e..af4161e 100755 --- a/script/process_merit_rules.rb +++ b/script/process_merit_rules.rb @@ -75,12 +75,11 @@ Environment.all.each do |environment| end group_control = YAML.load(File.read(File.join(Rails.root,'tmp','control_group.yml'))) if File.exist?(File.join(Rails.root,'tmp','control_group.yml')) - conditions = group_control.nil? ? {} : {:identifier => group_control[profile_id]['profiles']} + conditions = group_control.nil? ? {} : {:identifier => group_control.map{|k,v| v['profiles']}.flatten} people_count = environment.people.where(conditions).count person_index = 0 puts "Analising environment people" -puts conditions.inspect - environment.people.find_each(conditions) do |person| + environment.people.find_each(:conditions => conditions) do |person| person_index += 1 puts "Analising person #{person_index} of #{people_count}" create_action(person, person_index, people_count) -- libgit2 0.21.2