Created
July 21, 2010 18:51
-
-
Save timothyf/484935 to your computer and use it in GitHub Desktop.
Using ActiveRecord Outside of Rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require_gem "activerecord" | |
ActiveRecord::Base.establish_connection ( | |
:adapter => "mysql", | |
:host => "localhost", | |
:username => "root", | |
:database => "HumanResources") | |
class Employee < ActiveRecord::Base | |
end | |
employee = Employee.new | |
employee.first_name = "Fred" | |
employee.last_name = "Flinstone" | |
employee.save |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment