Created
June 27, 2016 05:52
-
-
Save dineshsprabu/a229668beae58214c1529553ccecb254 to your computer and use it in GitHub Desktop.
[RUBY] Using Active Records in Ruby Scripts
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 '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