Skip to content

Commit

Permalink
make sure to set govs and their offices to active
Browse files Browse the repository at this point in the history
  • Loading branch information
msimonborg committed Jun 20, 2017
1 parent 07fb3df commit d8989b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/db_pyr_update.rb
Expand Up @@ -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}"
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/db_update.rake
Expand Up @@ -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
Expand Down

0 comments on commit d8989b7

Please sign in to comment.