Questions tagged [apartment-gem]

Database multi-tenancy for Rack (and Rails) applications

Apartment provides tools to help you deal with multiple tenants in your Rails application. It helps you to have certain data sequestered based on account or company, but still allow some data to exist in a common tenant.

Resources:

176 questions
0
votes
1 answer

Dynamically override destination file of all Logger output in Rails

I am using the Apartment gem for a multi tenant Rails 5.2 app. I'm not sure that this even matters for my question but just giving some context. Is there a way to override the Rails logger and redirect every single log entry to a file based on the…
slindsey3000
  • 4,053
  • 5
  • 36
  • 56
0
votes
1 answer

ActiveStorage with ActiveJob and Apartment gem deserialization error

I am trying to use the Apartment gem with activestorage and activejob but I am running into an error with the default activestorage analysis task. I have a simple controller that uploads and stores the files. I get the following error when running…
Pras
  • 179
  • 2
  • 14
0
votes
1 answer

Rails Apartment Tenant LocalJumpError switch

I m creating a tenant when I click on a button in a view. The tenant is well create but when I try to switch to this tenant just after I have this error: LocalJumpError in EntreprisesController#create_tenant - no block given (yield). Thanks for any…
0
votes
1 answer

ruby create an apartment tenant error in router.

This is my error message :No route matches [GET] "/entreprises/10/create_tenant" I m trying to permit to create a tenant (gem apartment) when you list your own entreprises. In entreprise model is have an attribute called subdmain which should be…
0
votes
0 answers

rails user authentication on mulit tenancy system

Im currently creating a multi tenancy system in rails 5 using the gem Apartment I have a Tenant model which contains a Name and Tenant so I can create individual tenants (or companies). Each tenant has a users table. When a user logs in I set a…
Brad
  • 8,044
  • 10
  • 39
  • 50
0
votes
0 answers

report gem in rails

My team is creating a data management software in Rails using Apartment Gem for the individual customers (tenants). We are looking for a reporting gem that supports multi tenancy. Any suggestion is highly appreciated. Thank you very much, Corina
0
votes
0 answers

Scope Active Storage URL

A multi tenants app living on a subdomain give those kind of urls to tenants: subdomain.domain.com/:tenant-id/the-route-you-want All tenants have their own postgresql schema. Uploading with Active Storage works fine and the good schema got…
coding addicted
  • 3,422
  • 2
  • 36
  • 47
0
votes
1 answer

Apartment gem Custom Tenants Rails 5

I am building a multitenant application using the Apartment gem. I have the core features that will be common across all tenants. But now I want to add a table the schema for TenantB that will not be in the schema for TenantA. If I do the following…
0
votes
0 answers

Apartment gem breaks when creating a new tenant

I am trying to create a new tenant after the successful creation of a new shop. So I have a subdomain field in my shop model. I also added after_filter method to create a new tenant but it is throwing me some error. My shop model looks like…
0
votes
1 answer

Change response URL on Rails server

I am trying to change my response URL to redirect (without redirect) to custom subdomain. I am using devise and apartment and I am trying to use User's subdomain after successful request. before_action :authenticate_user! after_action …
Haris Krajina
  • 14,824
  • 12
  • 64
  • 81
0
votes
2 answers

Error When Switching Tenant Using Apartment Gem

i am getting error when execute Apartment::Tenant.switch!("tenant_name") even when the tenant were exists. When i run Apartment::tenant_names,it return an array contain ["murah5","rahmatullah","test"] then i run Apartment::Tenant.switch!("murah5")…
0
votes
0 answers

excluded_subdomains doesn't seems to be working

config/initializers/apartment/subdomain_exclusions.rb Apartment::Elevators::Subdomain.excluded_subdomains = ['www'] Above doesn't seems to be working. I'm using rails 5.0.2. in apartment.rb I have this…
Tauqeer Ahmad
  • 540
  • 4
  • 9
0
votes
0 answers

direct user to their respective subdomain after signing in

My user is able to sign up for the application and be directed to the appropriate subdomain that they type into the screen. I'd like them to be redirected back to the same subdomain when signing back in. I am not getting an error per say but when I…
nomad
  • 45
  • 9
0
votes
2 answers

no implicit conversion of Symbol into Integer in view forms

I am working on configuring the apartment gem for my rails app to give users the functionality to create subdomains. I have a nested form and when attempting to access "accounts/new" I am getting the following error: no implicit conversion of…
nomad
  • 45
  • 9
0
votes
1 answer

rails devise after_sign_up_path_for undefined method `subdomain'

I am attempting to redirect user after successfully signing up to their respective subdomain. I have input the following code within the application_controller. application_controller.rb protected def after_sign_in_path_for(resource) redirect_to…
nomad
  • 45
  • 9