init
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
development:
|
||||
adapter: mysql2
|
||||
encoding: utf8mb4
|
||||
database: dashboard_development
|
||||
username: root
|
||||
password: mypassword
|
||||
host: db
|
||||
port: 3306
|
||||
|
||||
production:
|
||||
adapter: mysql2
|
||||
encoding: utf8
|
||||
username: root
|
||||
password:
|
||||
database: sinatra_template_production
|
||||
@@ -0,0 +1,13 @@
|
||||
require 'bundler/setup'
|
||||
Bundler.require(:default, ENV['RACK_ENV'] || :development)
|
||||
|
||||
# Establish ActiveRecord Connection
|
||||
ActiveRecord::Base.configurations = YAML.load_file('config/database.yml')
|
||||
ActiveRecord::Base.establish_connection(ENV['RACK_ENV']&.to_sym || :development)
|
||||
|
||||
# Load Models
|
||||
Dir.glob(File.join(File.dirname(__FILE__), '../app/models', '*.rb')).each { |file| require file }
|
||||
require_relative '../app/controllers/application_controller'
|
||||
|
||||
# Enable ActiveRecord logging to stdout
|
||||
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
||||
Reference in New Issue
Block a user