add after_party task to populate bypass_email
This commit is contained in:
parent
cd6cb99c3c
commit
dbb1acbd75
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…
Add table
Add a link
Reference in a new issue