Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rubygems'
- require 'active_record'
- ActiveRecord::Base.establish_connection(
- :adapter=> "jdbcmysql",
- :host => "localhost",
- :database=> "testapp",
- :username => "root",
- :password => ""
- )
- class Rubyist < ActiveRecord::Base
- end
- Rubyist.create(:name => 'Mitali Talim', :city => "Nashville, Tenessee")
- Rubyist.create(:name => 'Sunil Kelkar', :city => "Pune, India")
- Rubyist.create(:name => 'Adam Smith', :city => "San Fransisco, USA")
- participant = Rubyist.find(:first)
- puts %{#{participant.name} stays in #{participant.city}}
- Rubyist.find(:first).destroy
Add Comment
Please, Sign In to add comment