Skip to content

Instantly share code, notes, and snippets.

@ksauzz
Created November 8, 2011 06:09
Show Gist options
  • Select an option

  • Save ksauzz/1347135 to your computer and use it in GitHub Desktop.

Select an option

Save ksauzz/1347135 to your computer and use it in GitHub Desktop.
Using ActiveRecord without Rails
require 'rubygems'
require 'active_record'
ActiveRecord::Base.establish_connection(
:pool => 5,
:adapter => "mysql",
:host => "xxx.xxx.xxx.xxx",
:username => "db_user",
:password => "db_pass",
:database => "db_name",
:encoding => "utf8"
)
class ModelName < ActiveRecord::Base
set_primary_key "xxx_id"
set_table_name "xxx_table"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment