lib/data_taster/helper.rb in data_taster-0.3.0 vs lib/data_taster/helper.rb in data_taster-0.4.0
- old
+ new
@@ -11,15 +11,11 @@
sanitized_command = sanitized_command.gsub(Shellwords.escape(params["password"]), "<pwd>") if params
sanitized_command
end
- def db_yml
- @db_yml ||= YAML.safe_load(ERB.new(Rails.root.join("config", "database.yml").read).result, aliases: true)
- end
-
def db_config
- @db_config ||= db_yml[Rails.env]
+ ActiveRecord::Base.configurations.configs_for(env_name: Rails.env, name: "primary").configuration_hash
end
def logg(message)
DataTaster.logger.debug { "[#{Time.current}] #{message}" }
end