I have defined gem in my Gemfile as
gem 'apartment', git: 'git@github.com:rtcreativegroup/apartment.git', branch: 'crashdown-rails-5'
beacuse I am using sqlserver adapter.
When I call Apartment::Tenant.create('tenant1'), it gives errors saying
NoMethodError: undefined method name' for #<ActiveSupport::HashWithIndifferentAccess:0x007faf96aa8f00> from /Users/vinaymehta/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:850:inestablish_connection'
I checked the file and found the error is in calling methods like spec.name or spec.config etc. in the connection_pool.rb file. I print my spec and it comes like
{"adapter"=>"sqlserver", "mode"=>"dblib", "host"=>"MYHost", "port"=>Port, "database"=>"MYDB", "username"=>"USERNAME", "password"=>"PASSWORD", "timeout"=>50000000, "azure"=>true, "name"=>"NAME"}.
I tried to fix this by having condition on this line if the class of spec is HashwithIndifferentAccess then use values like spec["name"]
But then it started giving errors in other lines like
NoMethodError: undefined method `config' or 'adapter_method' for #ActiveSupport::HashWithIndifferentAccess:0x007fbf8135c710
System configuration
ruby 2.3.1p112
Rails 5.0.6
apartment (1.2.0)
Apartment config (in config/initializers/apartment.rb or so):
please post your config, the full trace, and explain how that HashWithIndifferentAccess you've referenced fits into the picture? (is that data from your database.yml?)
I have defined gem in my Gemfile as gem 'apartment', git: 'git@github.com:rtcreativegroup/apartment.git', branch: 'crashdown-rails-5' beacuse I am using sqlserver adapter.
When I call Apartment::Tenant.create('tenant1'), it gives errors saying
I checked the file and found the error is in calling methods like spec.name or spec.config etc. in the connection_pool.rb file. I print my spec and it comes like {"adapter"=>"sqlserver", "mode"=>"dblib", "host"=>"MYHost", "port"=>Port, "database"=>"MYDB", "username"=>"USERNAME", "password"=>"PASSWORD", "timeout"=>50000000, "azure"=>true, "name"=>"NAME"}. I tried to fix this by having condition on this line if the class of spec is HashwithIndifferentAccess then use values like spec["name"] But then it started giving errors in other lines like NoMethodError: undefined method `config' or 'adapter_method' for #ActiveSupport::HashWithIndifferentAccess:0x007fbf8135c710
System configuration
ruby 2.3.1p112 Rails 5.0.6 apartment (1.2.0)
config/initializers/apartment.rb
or so):use_schemas
: (true
orfalse
) (tried both)