Has anyone successfully used the Rails acts_as_tenant gem for multitenancy, where the tenant ID column is not named xxx_id?
my model is something like
has_one :tenant, :foreign_key => "tenant_code"
acts_as_tenant :tenant
Then I get my query…
I am using Devise and ActsAsTenant for a multi-tenant saas rails 7 app and am having trouble redirecting users to the correct subdomain after login with Device.
Each User is associated with an Account that has a subdomain column. I have read through…
I made a user with two accounts, a user should have documents that are scoped to the account they belong to. I'm writing tests that @user.documents should be different if they are under @account_1 vs @account_2
ActsAsTenant.with_tenant(@account_1)…
I'm working on a project with I use ActionCable, at the moment I'm learning about acts_as_tenant gem.
I implement it in the project, but my WebSockets don't work.
If I'm logged in subdomain1, and send data by the ActionCable on subdomain2, I receive…
When trying to create a distributed table with Citus, it gives a PG::UndefinedColumn: ERROR: column "x" does not exist
I have enabled Citus on workers and main DB:
SELECT run_command_on_workers($cmd$
CREATE EXTENSION citus;
$cmd$);
I created a…
I am using Active Admin in my multi tenant app. I also use Searchkick which has a custom tenant specific index in each model:
class Budget < ApplicationRecord
multi_tenant :company
searchkick inheritance: true,index_name: -> {…
We have a SAAS platform written in Rails using the postgres' schema based multitenancy and Apartment gem. The different schemas are identical, with same number of tables and same columns in each table. We want to migrate to foreign key based…
Anyone managed to get this to work with ActiveAdmin? It seems that with AA you can only access the records that your normal user was last logged in under (i.e. AR is still scoping the DB calls with the last tenant). I know there is the…
I am using acts_as_tenant gem to manage a multi-tenant platform while using devise to manage users. A User in our system acts_as_tenant and belongs_to Organization. Organization acts_as_tenant and has_many Users.
We are having trouble understanding…
We are building a tenant based web app using acts_as_tenant gem. Since we are running same app for all the tenants so we have only one log file in whole system. This is causing problem when we need to analyze log of a particular tenant, Currently we…
I'm working on the admin page for an application with a model called DealerBranch and a tenanted nested association called Address. I have a controller that looks like this for creating a new dealer branch:
class Admin::DealerBranchesController <…
I'm using acts_as_tenant gem that injects default scope in my models.
I also use Sunspot for search like so:
Article.search do
with(:organization_id, ActsAsTenant.current_tenant.id)
fulltext params[:search]
end
Article model is scoped so that…
I have a Rails app using Devise and it also uses acts_as_tenant.
In my applications controller I create a variable for the url (including the tenant prefix). It's called $request_url
The issue is that the URL in the confirmation email doesn't change…
I am attempting to use the acts_as_tenant gem to scope SQL queries for multiple organizations. RSpec/FactoryGirl are pulling some dirty tricks, however.
A bit of background: in my app, User and Grant both belong to an Organization. Only admin users…
I am using acts_as_tenant gem to do a multi-tenant app. I followed the instructions. I am using sub-domains.
In my application_controller.rb I have:
set_current_tenant_by_subdomain(:account, :subdomain)
I am using Account as the tenant. In my User…