Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. [1] pry(main)> Album.where(title: 'A Love Supreme').first
  2. Album Load (2.1ms) SELECT "albums".* FROM "albums" WHERE "albums"."title" = 'A Love Supreme' ORDER BY "albums"."id" ASC LIMIT 1
  3. => #<Album id: 1, artist: "John Coltrane", title: "A Love Supreme", year: 1965, song_count: 3, user_id: 2, created_at: "2014-11-29 23:21:16", updated_at: "2014-12-08 15:23:54", featured: false>
  4. [2] pry(main)> Album.where(title: 'A Love Supreme').first.update_attribute(:featured, true)
  5. Album Load (0.5ms) SELECT "albums".* FROM "albums" WHERE "albums"."title" = 'A Love Supreme' ORDER BY "albums"."id" ASC LIMIT 1
  6. (0.1ms) BEGIN
  7. SQL (0.3ms) UPDATE "albums" SET "featured" = $1, "updated_at" = $2 WHERE "albums"."id" = 1 [["featured", "t"], ["updated_at", "2014-12-15 15:46:19.646739"]]
  8. (1.0ms) COMMIT
  9. => true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement