tasks: populate Instructeur.bypass_email_login_token again
The task was run once in April 2021, but the new features enabled since have not been synchronized.
This commit is contained in:
parent
28dfc6a1ba
commit
103502931a
1 changed files with 18 additions and 0 deletions
|
@ -0,0 +1,18 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: populate_bypass_email_login'
|
||||
task populate_bypass_email_login: :environment do
|
||||
user_ids = Flipper::Adapters::ActiveRecord::Gate
|
||||
.where(feature_key: 'instructeur_bypass_email_login_token')
|
||||
.pluck(:value)
|
||||
.filter { |s| s.start_with?('User:') }
|
||||
.map { |s| s.gsub('User:', '') }
|
||||
.map(&:to_i)
|
||||
|
||||
Instructeur
|
||||
.where(user: { id: user_ids })
|
||||
.update_all(bypass_email_login_token: true)
|
||||
|
||||
AfterParty::TaskRecord
|
||||
.create version: AfterParty::TaskRecorder.new(__FILE__).timestamp
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue