Account.sole → Current.account
and some other de-tenant changes, including removing the controller tenanting concerns
This commit is contained in:
@@ -15,13 +15,13 @@ ApplicationRecord.with_each_tenant do |tenant|
|
||||
# Create a new Identity
|
||||
Identity.transaction do
|
||||
identity = Identity.create!
|
||||
user.membership = identity.memberships.create!(user_id: user.id, user_tenant: user.tenant, email_address: user.email_address, account_name: Account.sole.name)
|
||||
user.membership = identity.memberships.create!(user_id: user.id, user_tenant: user.tenant, email_address: user.email_address, account_name: Current.account.name)
|
||||
puts "Created identity #{identity.id} for user #{user.id} (#{user.email_address})"
|
||||
end
|
||||
else
|
||||
# Merge this User's Membership into the existing Identity
|
||||
identity = memberships.first.identity
|
||||
user.membership = identity.memberships.create!(user_id: user.id, user_tenant: user.tenant, email_address: user.email_address, account_name: Account.sole.name)
|
||||
user.membership = identity.memberships.create!(user_id: user.id, user_tenant: user.tenant, email_address: user.email_address, account_name: Current.account.name)
|
||||
puts "Merged membership for user #{user.id} (#{user.email_address}) into identity #{identity.id}"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ def fix_attachments(rich_text)
|
||||
end
|
||||
|
||||
ApplicationRecord.with_each_tenant do |tenant|
|
||||
account_id = Account.sole.queenbee_id
|
||||
account_id = Current.account.queenbee_id
|
||||
|
||||
unless account_id
|
||||
puts "Skipping URL fixup for tenant: #{tenant}"
|
||||
@@ -37,7 +37,7 @@ ApplicationRecord.with_each_tenant do |tenant|
|
||||
domain = domains[Rails.env] || domains["production"]
|
||||
regex = %r{://\w+\.#{domain}/}
|
||||
|
||||
pp [ Account.sole.name, account_id, domain, regex ]
|
||||
pp [ Current.account.name, account_id, domain, regex ]
|
||||
puts
|
||||
|
||||
Card.find_each do |card|
|
||||
|
||||
Reference in New Issue
Block a user