Merge branch 'dev' into enforce-rubocop-timezone
This commit is contained in:
commit
cf610bbd91
22 changed files with 284 additions and 157 deletions
17
lib/tasks/2019_02_18_migrate_service_organisme.rake
Normal file
17
lib/tasks/2019_02_18_migrate_service_organisme.rake
Normal file
|
@ -0,0 +1,17 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: migrate service organisme'
|
||||
task migrate_service_organisme: :environment do
|
||||
table = {
|
||||
'commune': 'collectivite_territoriale',
|
||||
'departement': 'collectivite_territoriale',
|
||||
'region': 'collectivite_territoriale',
|
||||
'prefecture': 'service_deconcentre_de_l_etat'
|
||||
}
|
||||
|
||||
table.each do |(old_name, new_name)|
|
||||
Service.where(type_organisme: old_name).update_all(type_organisme: new_name)
|
||||
end
|
||||
|
||||
AfterParty::TaskRecord.create version: '20190201121252'
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue