Flowdock
method

config

Importance_0
v5.2.3 - Show latest stable - 0 notes - Class: Rails::DBConsole
config() public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File railties/lib/rails/commands/dbconsole/dbconsole_command.rb, line 90
    def config
      @config ||= begin
        # We need to check whether the user passed the connection the
        # first time around to show a consistent error message to people
        # relying on 2-level database configuration.
        if @options["connection"] && configurations[connection].blank?
          raise ActiveRecord::AdapterNotSpecified, "'#{connection}' connection is not configured. Available configuration: #{configurations.inspect}"
        elsif configurations[environment].blank? && configurations[connection].blank?
          raise ActiveRecord::AdapterNotSpecified, "'#{environment}' database is not configured. Available configuration: #{configurations.inspect}"
        else
          configurations[environment].presence || configurations[connection]
        end
      end
    end
Register or log in to add new notes.