Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >> u = User.new(:email => "foo@bar.com")
- => #<User @id=nil @password=nil @salt=nil @first_name=nil @last_name=nil @email="foo@bar.com" @birthday=nil>
- >> u.inspect
- => "#<User @id=nil @password=nil @salt=nil @first_name=nil @last_name=nil @email=\"foo@bar.com\" @birthday=nil>"
- >> u.valid?
- => true
- >> u.saved?
- => false
- >> u
- => #<User @id=nil @password=nil @salt=nil @first_name=nil @last_name=nil @email="foo@bar.com" @birthday=nil>
- >> u.save
- ~ (0.116362) SET backslash_quote = off
- ~ (0.115933) SET standard_conforming_strings = on
- ~ (0.115910) SET client_min_messages = warning
- ~ (0.121758) INSERT INTO "users" DEFAULT VALUES RETURNING "id"
- => true
- >> u
- => #<User @id=4 @password=nil @salt=nil @first_name=nil @last_name=nil @email="foo@bar.com" @birthday=nil>
- >> User.get(4)
- ~ (0.118055) SELECT "id", "password", "salt", "first_name", "last_name", "email", "birthday" FROM "users" WHERE "id" = 4 LIMIT 1
- => #<User @id=4 @password=nil @salt=nil @first_name=nil @last_name=nil @email=nil @birthday=nil>
- >>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement