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
- Host: GitHub
- URL: https://github.com/chip/invoicethat-admin
- Owner: chip
- Created: 2011-04-06T00:20:30.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2011-05-20T12:57:52.000Z (about 15 years ago)
- Last Synced: 2025-04-30T10:33:39.139Z (about 1 year ago)
- Language: Ruby
- Homepage: https://github.com/chip/invoicethat-admin
- Size: 93.8 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
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)