Open CR1AT0RS opened 4 years ago
I also tried this within the database that I am using for this rails app:
CREATE EXTENSION pg_trgm; ERROR: extension 'pg_trgm' already exists
No luck same error.
From our experience, adding gin_trgm_ops
to pg_excluded_names
in our config/initializers/apartment.rb
fixed a very similar looking issue :-)
Steps to reproduce
Rails console
Expected behavior
Create Tenant named "demo"
Actual behavior
System configuration
Database: (Tell us what database and its version you use.) Postgres 9.5 OSX
Apartment version: gem 'apartment', git: 'https://github.com/influitive/apartment.git', :branch => "development"
Apartment config (in
config/initializers/apartment.rb
or so):#
Apartment Configuration
# Apartment.configure do |config|
Add any models that you do not want to be multi-tenanted, but remain in the global (public) namespace.
A typical example would be a Customer or Tenant model that stores each Tenant's information.
# config.excluded_models = %w{ Landlord }
config.tenant_names = lambda { User.pluck :subdomain }
end
Rails.application.config.middleware.use Apartment::Elevators::Subdomain
Rails.application.config.middleware.use Apartment::Elevators::FirstSubdomain
Rails.application.config.middleware.use Apartment::Elevators::Host
use_schemas: false
6.0
2.7.1