From d8989b753c2643a27c173ff9767c94874b41f199 Mon Sep 17 00:00:00 2001 From: "M. Simon Borg" Date: Tue, 20 Jun 2017 14:00:16 -0400 Subject: [PATCH] make sure to set govs and their offices to active --- lib/db_pyr_update.rb | 2 ++ lib/tasks/db_update.rake | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/db_pyr_update.rb b/lib/db_pyr_update.rb index 953fa496..57a580e4 100644 --- a/lib/db_pyr_update.rb +++ b/lib/db_pyr_update.rb @@ -20,6 +20,7 @@ def call db_gov = Governor.find_or_create_by(official_full: gov.official_full, state: state) update_basic_info(db_gov, gov) db_gov.add_photo + db_gov.active = true db_gov.save gov.office_locations.each { |off| update_office(db_gov, off) } puts "Updated #{db_gov.official_full}" @@ -34,6 +35,7 @@ def update_office(db_gov, off) o.phone = off[:phone] o.fax = off[:fax] o.office_type = off[:office_type] + o.active = true o.save o.add_v_card end diff --git a/lib/tasks/db_update.rake b/lib/tasks/db_update.rake index a6efb91e..5e27296d 100644 --- a/lib/tasks/db_update.rake +++ b/lib/tasks/db_update.rake @@ -108,7 +108,7 @@ namespace :db do end desc 'Update all reps and office_locations in database from default yaml files' - task all: %i[retired_reps current_reps socials office_locations] do + task all: %i[retired_reps current_reps socials office_locations governors] do if ENV['qr_codes'] == 'true' && Rails.env.development? Rake::Task['pyr:qr_codes:create'].invoke end