Open gmhawash opened 5 years ago
Difficult in current architecture as apartment relays on ActiveRecord
it requires activerecord
Active record is fine, but in the file https://github.com/influitive/apartment/blob/a4332c3222210b11f5e8c27fa4c1a18b492e9629/lib/apartment/adapters/abstract_adapter.rb, in the environmentify
method, you refer to Rails.env
which forces a dependency on Rails which is not necessary for this gem.
gotcha, thanks
@gmhawash Did you work out a solution to get the gem to work within a ruby project?
@arinhouck I did not, but I avoid using create_tenant_command
, and it is not necessary for Postgresql. If you must, you could define a module in an initialization file as follows:
module Rails
module_function :env
def env
ENV['RACK_ENV'] # or whatever you use to declare an env.
end
end
Hello,
I have a multi-tenant PG application that uses standalone ruby workers to access the database. I'd like to be able to use the Apartment gem to create schemas and switch to schemas from these standalone workers. How is this possible?
Thanks