Questions tagged [acts-as-tenant]

Multi-tenancy for Rails in a shared database setup.

Multi-tenancy for Rails in a shared database setup.

https://github.com/ErwinM/acts_as_tenant

37 questions
0
votes
1 answer

Unable to create a simple model instance with acts_as_tenant

I'm using a gem https://github.com/dsaronin/milia. One of my models is called Group: class Group < ActiveRecord::Base #..... acts_as_tenant end But I can't create it for some reason. Here's rails console: t = Tenant.create(cname: 'cname1',…
user266003
0
votes
1 answer

Unable to create an user with "tenant"

I'm using a gem milia and devise. class User < ActiveRecord::Base # ... acts_as_universal_and_determines_account #... end class Tenant < ActiveRecord::Base acts_as_universal_and_determines_tenant def self.create_new_tenant(params) …
Incerteza
  • 32,326
  • 47
  • 154
  • 261
0
votes
1 answer

Rails Acts As Tenant error using current_tenant in controller

I'm using Acts_as_tenant. The doc says "adds a handy helper to your controllers current_tenant, containing the current tenant object". But, I'd like to access the current tenant in a model. The Tenant model contains a column - request_closed. I…
Reddirt
  • 5,913
  • 9
  • 48
  • 126
0
votes
1 answer

Extending gem/engine models to include acts_as_tenant from main app

There are a few post on this subject but the light has not turned on yet. I'm trying to extend a rails gem/engine Plutus to use acts_as_tenant Plutus provides a double entry accounting system for an application. One of the limitations is that the…
appleII717
  • 328
  • 3
  • 12
0
votes
1 answer

User unable to sign_in after adding acts_as_tenant

I'm using Clearance for authentication and acts_as_tenant to set tenant User.rb Clearance::User::Validations.module_eval do included do email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i validates :email, uniqueness: { scope:…
0
votes
1 answer

How to ensure as_as_tenant scoped by subdomain can reset password with devise

I'm using devise and acts_as_tenant gem and it seems the devise controllers don't inherit from ApplicationController (???) so don't have access to set_current_tenant_by_subdomain When the password reset link is clicked I get no Tenant scoping by…
Colin Goudie
  • 845
  • 5
  • 10
0
votes
1 answer

how to reference acts_as_tenant current_tenant from cancan ability.rb

I have some overall permissions set against the current_tenant - I can reference these from within a controller i.e. current_tenant.has_some_capability? works fine. I would like to wrap this up using CanCan, if I put the following in my ability.rb…
Craig McGuff
  • 3,968
  • 6
  • 30
  • 35
1 2
3