Advertisement
Guest User

Untitled

a guest
Jan 21st, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. require 'rubygems'
  2. require 'active_record'
  3. ActiveRecord::Base.establish_connection(
  4. :adapter=> "mysql",
  5. :host => "localhost",
  6. :database=> "lpv",
  7. :password => "codefellas"
  8. )
  9.  
  10. class User < ActiveRecord::Base
  11. end
  12.  
  13. def createUser(userName, pass)
  14. User.create(:username => userName, :name=> null, :surname=> null, :password => pass, :access_level=> 5, :email=> null, :mobile=> null)
  15. end
  16.  
  17. createUser("alican","123456")
  18. #Rubyist.create(:name => 'Luc Juggery', :city => "Nashville, Tenessee")
  19. #Rubyist.create(:name => 'Sunil Kelkar', :city => "Pune, India")
  20. #Rubyist.create(:name => 'Adam Smith', :city => "San Fransisco, USA")
  21.  
  22. #participant = Rubyist.find(:first)
  23. #puts %{#{participant.name} stays in #{participant.city}}
  24.  
  25. #Rubyist.find(:first).destroy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement