Method: Rails::Initializer#initialize_database
- Defined in:
- lib/initializer.rb
#initialize_database ⇒ Object
This initialization routine does nothing unless :active_record is one of the frameworks to load (Configuration#frameworks). If it is, this sets the database configuration from Configuration#database_configuration and then establishes the connection.
226 227 228 229 230 |
# File 'lib/initializer.rb', line 226 def initialize_database return unless configuration.frameworks.include?(:active_record) ActiveRecord::Base.configurations = configuration.database_configuration ActiveRecord::Base.establish_connection end |