Method: Rpush200Updates.adapter_name

Defined in:
lib/generators/templates/rpush_2_0_0_updates.rb

.adapter_nameObject


59
60
61
62
63
64
65
66
# File 'lib/generators/templates/rpush_2_0_0_updates.rb', line 59

def self.adapter_name
  env = (defined?(Rails) && Rails.env) ? Rails.env : 'development'
  if ActiveRecord::VERSION::MAJOR > 6
    ActiveRecord::Base.configurations.configs_for(env_name: env).first.configuration_hash[:adapter]
  else
    Hash[ActiveRecord::Base.configurations[env].map { |k,v| [k.to_sym,v] }][:adapter]
  end
end