Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Mar 18th, 2012  |  syntax: None  |  size: 1.99 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. >> a = Answer.new
  2. => #<Answer id=nil data=nil project_id=nil task_id=nil>
  3. >> a.input_for << Task.get(50)
  4. Thu, 06 Aug 2009 23:28:50 GMT ~ debug ~ (0.000084) SELECT "id", "price", "state", "user_id", "input_id", "project_id" FROM "tasks" WHERE ("id" = 50) ORDER BY "id" LIMIT 1
  5. Thu, 06 Aug 2009 23:28:50 GMT ~ debug ~ (0.000061) SELECT "id", "price", "state", "user_id", "input_id", "project_id" FROM "tasks" WHERE ("input_id" IN (NULL)) ORDER BY "id"
  6. => [#<Task id=50 price=#<BigDecimal:21629c8,'0.1E0',4(8)> state=:skipped created_at=<not loaded> updated_at=<not loaded> submitted_at=<not loaded> user_id=29 input_id=nil project_id=1>]
  7. >> a.input_for << Task.get(40)
  8. Thu, 06 Aug 2009 23:28:58 GMT ~ debug ~ (0.000066) SELECT "id", "price", "state", "user_id", "input_id", "project_id" FROM "tasks" WHERE ("id" = 40) ORDER BY "id" LIMIT 1
  9. => [#<Task id=50 price=#<BigDecimal:21629c8,'0.1E0',4(8)> state=:skipped created_at=<not loaded> updated_at=<not loaded> submitted_at=<not loaded> user_id=29 input_id=nil project_id=1>, #<Task id=40 price=#<BigDecimal:2159990,'0.1E0',4(8)> state=:skipped created_at=<not loaded> updated_at=<not loaded> submitted_at=<not loaded> user_id=29 input_id=nil project_id=1>]
  10. >> a.save
  11. Thu, 06 Aug 2009 23:29:00 GMT ~ debug ~ (0.003242) INSERT INTO "answers" DEFAULT VALUES
  12. Thu, 06 Aug 2009 23:29:00 GMT ~ debug ~ (0.000090) SELECT "created_at", "updated_at", "submitted_at", "id" FROM "tasks" WHERE ("input_id" IN (NULL)) AND ("id" IN (50, 40)) ORDER BY "id"
  13. Thu, 06 Aug 2009 23:29:00 GMT ~ debug ~ (0.000066) SELECT "created_at", "updated_at", "submitted_at", "id" FROM "tasks" WHERE ("id" = 50) ORDER BY "id"
  14. Thu, 06 Aug 2009 23:29:00 GMT ~ debug ~ (0.002999) UPDATE "tasks" SET "input_id" = 16, "created_at" = '2009-08-06T12:24:51+00:00', "updated_at" = '2009-08-06T16:29:00+00:00' WHERE ("id" = 50)
  15. Thu, 06 Aug 2009 23:29:00 GMT ~ debug ~ (0.000085) SELECT "id", "price", "state", "user_id", "input_id", "project_id" FROM "tasks" WHERE ("input_id" IN (16)) ORDER BY "id"
  16. => true
  17. >>