Merge pull request #7017 from tchak/migration-dossiers-deleted-scopes
migrate(dossier): fill hidden_by_administration_at and hidden_by_user_at from hidden_at
This commit is contained in:
commit
bda6f81528
1 changed files with 16 additions and 0 deletions
|
@ -0,0 +1,16 @@
|
||||||
|
namespace :after_party do
|
||||||
|
desc 'Deployment task: seed_hidden_at_dossiers'
|
||||||
|
task seed_hidden_at_dossiers: :environment do
|
||||||
|
puts "Running deploy task 'seed_hidden_at_dossiers'"
|
||||||
|
|
||||||
|
Dossier
|
||||||
|
.where.not(hidden_at: nil)
|
||||||
|
.where(hidden_by_user_at: nil, hidden_by_administration_at: nil)
|
||||||
|
.update_all('hidden_by_user_at = hidden_at, hidden_by_administration_at = hidden_at')
|
||||||
|
|
||||||
|
# Update task as completed. If you remove the line below, the task will
|
||||||
|
# run with every deploy (or every time you call after_party:run).
|
||||||
|
AfterParty::TaskRecord
|
||||||
|
.create version: AfterParty::TaskRecorder.new(__FILE__).timestamp
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue