User administration for invoicethat.com
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.bundle
views
.gitignore
Gemfile
README.rdoc
app.rb
bundler_config.xml
config.ru
database.rb

README.rdoc

User administration for invoicethat.com

Description:

This is a tiny little micro-app written in Sinatra that allows me to administer users of invoicethat.com.

Database connection setup

# This was an important first step for loading the models used by Rails

RAILS_ROOT = '/Users/deploy/Sites/rails_invoice'

require 'active_support'
relative_load_paths = %w(app/models)
::ActiveSupport::Dependencies.load_paths = relative_load_paths.map { |path|
  File.expand_path(path, RAILS_ROOT)
}
require 'active_record'
config_path     = File.expand_path('config/database.yml', RAILS_ROOT)
all_envs_config = YAML.load(File.read(config_path)) 
config          = all_envs_config[ENV['RACK_ENV']]
::ActiveRecord::Base.establish_connection(config)