module RawgentoModels

Constants

CONF_FILE
MIGRATION_PATH

When required, provide migrations.

VERSION

Public Class Methods

establish_connection(config_file_path=CONF_FILE) click to toggle source

Reads config and wires up AR

# File lib/rawgento_models.rb, line 23
def self.establish_connection(config_file_path=CONF_FILE)
  config = OpenStruct.new YAML.load_file(config_file_path)
  ActiveRecord::Base.establish_connection(config.default)
  #ActiveRecord::Base.establish_connection({
  #  :adapter => 'mysql2',
  #  :host => 'localhost',
  #  :username => 'dbuser',
  #  :password => '',
  #  :database => 'your_database',
  #})
end
load_tasks() click to toggle source
# File lib/rawgento_models.rb, line 35
def self.load_tasks
  #load 'active_record/railties/databases.rake'
  ActiveRecordMigrations.load_tasks
  #load "rawgento_models.rake"
end