Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rubygems'
- require 'active_record'
- ActiveRecord::Base.establish_connection(
- :adapter=> "mysql",
- :host => "localhost",
- :database=> "lpv",
- :password => "codefellas"
- )
- class User < ActiveRecord::Base
- end
- def createUser(userName, pass)
- User.create(:username => userName, :name=> null, :surname=> null, :password => pass, :access_level=> 5, :email=> null, :mobile=> null)
- end
- createUser("alican","123456")
- #Rubyist.create(:name => 'Luc Juggery', :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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement