Advertisement
Guest User

Untitled

a guest
Jul 8th, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.01 KB | None | 0 0
  1. >> u = User.new(:email => "foo@bar.com")
  2. => #<User @id=nil @password=nil @salt=nil @first_name=nil @last_name=nil @email="foo@bar.com" @birthday=nil>
  3. >> u.inspect
  4. => "#<User @id=nil @password=nil @salt=nil @first_name=nil @last_name=nil @email=\"foo@bar.com\" @birthday=nil>"
  5. >> u.valid?
  6. => true
  7. >> u.saved?
  8. => false
  9. >> u
  10. => #<User @id=nil @password=nil @salt=nil @first_name=nil @last_name=nil @email="foo@bar.com" @birthday=nil>
  11. >> u.save
  12.  ~ (0.116362) SET backslash_quote = off
  13.  ~ (0.115933) SET standard_conforming_strings = on
  14.  ~ (0.115910) SET client_min_messages = warning
  15.  ~ (0.121758) INSERT INTO "users" DEFAULT VALUES RETURNING "id"
  16. => true
  17. >> u
  18. => #<User @id=4 @password=nil @salt=nil @first_name=nil @last_name=nil @email="foo@bar.com" @birthday=nil>
  19. >> User.get(4)
  20.  ~ (0.118055) SELECT "id", "password", "salt", "first_name", "last_name", "email", "birthday" FROM "users" WHERE "id" = 4 LIMIT 1
  21. => #<User @id=4 @password=nil @salt=nil @first_name=nil @last_name=nil @email=nil @birthday=nil>
  22. >>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement