I have read in a blog that I could "make" a dynamodb table multi tenant using the tenant id as the partition key and for e.g. the sort key as the customer id.
It's sounds good, but imagine that I have a big workload for a tenant id = X, so I am…
I have an application that's using Devise to handle sign in/registration. I'm also using acts_as_tenant. I need to ensure a Tenant is set every time someone goes to register/sign in. For acts as tenant to work, the tenant must be set prior to…
Im using gem 'acts_as_tenant' in a Rails 3 app.
I set the tenant in the applications controller based on domain:
set_current_tenant_by_subdomain(:tenant, :subdomain)
I have code in the workorder model that needs to use the current_tenant:
class…
I am using ActsAsTenant, and I keep getting the error below on any Devise route (i.e. any Devise controller). It seems that Devise tries to get the current_user or something to do with getting a User before the tenant has been set, so ActsAsTenant…
I am trying to create an integration test with Capybara/RSpec that has a valid current_user (using the Warden.test_mode! trick) and I have also created a valid current_tenant by doing this in the test:
ActsAsTenant.current_tenant =…
Example...
I have a class called client which is my tenant model.
I have associated records to save along with each new client that gets created.
Let's call them tasks.
I created an after_initialize callback inside of client that calls a method…
I have a multi-tenancy app using ascts_as_tenant. I am trying to write a spec that tests a scope. So I want to test the output of User.active.
In general this works fine with code such as the following
it "returns a correct active user" do
…
I am loving using the blueprinter gem for my API, but i'm finding using it with the acts_as_tenant gem kinda cumbersome with associations. I have to pass in the account as options, which gets annoying when you have more than one association or…
I am using the Acts as Tenant gem for Rails and, if I understood it right when using the acts_as_tenant :tenant on models/course.rb, it automatically includes the relationships between models (i.e. belongs_to :tenant and has_many :courses).
So, now…
I have a little app where i have changed account to venue and am now hitting an issue on user create with venue attributes
NoMethodError in Users::RegistrationsController#create
undefined method `each_with_index' for…
I have a rails model Thing that uses acts_as_tenant to tie it to a company. This works fine, and now users who are part of a company can only access the Things associated with their company.
class Thing < ApplicationRecord
…
I am going to try and make this work in my Rails app but I figured I would see if anyone knew of a gotcha that would stop me in the tracks.
The basic premise is that I have the following models:
Company - the tenants in acts_as_tenant
User - unique…
My application main gems: rails 4.1.1, pg, acts_as_tenant, devise and activeadmin.
Application description: saas multi-tenant app with subdomains (not using postgresql schemas).
I have 2 models: Account and User with:
account belongs_to :owner a…
I'm using acts_as_tenant keyed on subdomain, and would like the "tenant" to be able to make changes to his Account record (change his subdomain), but not see anyone elses entry.
Adding an account_id column to Account with the same id as Account.id,…