Skip to content

Instantly share code, notes, and snippets.

@dineshsprabu
Created June 27, 2016 05:52
Show Gist options
  • Save dineshsprabu/a229668beae58214c1529553ccecb254 to your computer and use it in GitHub Desktop.
Save dineshsprabu/a229668beae58214c1529553ccecb254 to your computer and use it in GitHub Desktop.
[RUBY] Using Active Records in Ruby Scripts
require 'active_record'
ActiveRecord::Base.establish_connection ({
:adapter => "mysql2",
:host => "localhost",
:username => "root",
:password => "",
:database => ""})
class TableName < ActiveRecord::Base
end
list_all = TableName.all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment