you are here: codestackercodes [RSS]activerecord without rails

activerecord without rails

require 'active_record'

ActiveRecord::Base.establish_connection(:adapter => 'mysql2', :host => 'localhost', :user => 'root', :password => 'mypass', :database => 'mydatabase')

class User < ActiveRecord::Base ; end

puts User.count
#=> 9

Comments