An open API service indexing awesome lists of open source software.

https://github.com/chip/invoicethat-admin

User administration for invoicethat.com
https://github.com/chip/invoicethat-admin

Last synced: 11 months ago
JSON representation

User administration for invoicethat.com

Awesome Lists containing this project

README

          

= User administration for {invoicethat.com}[http://invoicethat.com]

* http://github.com/chip/invoicethat-admin

== 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)