Remove the internal API
* Bind sessions to identities * Remove references to the identity token * Move email changes to identity * Move account menu into a turbo-frame * Create tenants from a tenanted route
This commit is contained in:
committed by
Stanko K.R.
parent
440631c790
commit
98755844a1
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require_relative "../../config/environment"
|
||||
|
||||
ApplicationRecord.with_each_tenant do |tenant|
|
||||
puts "🏢 #{tenant}"
|
||||
User.find_each do |user|
|
||||
next if user.system? || !user.active?
|
||||
|
||||
if user.membership.present?
|
||||
puts "✅ User #{user.id} has a membership"
|
||||
else
|
||||
puts "⏩ Creating membership for user #{user.id}"
|
||||
|
||||
identity = Identity.find_or_create_by(email_address: user.email_address)
|
||||
membership = identity.memberships.find_or_create_by(tenant: tenant)
|
||||
user.update_columns(membership_id: membership.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user