find_cache 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGE-LOG +8 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +80 -0
- data/Rakefile +38 -0
- data/lib/find_cache.rb +5 -0
- data/lib/find_cache/cacheable.rb +88 -0
- data/lib/find_cache/init.rb +1 -0
- data/lib/find_cache/key_gen.rb +27 -0
- data/lib/find_cache/version.rb +3 -0
- data/lib/tasks/find_cache_tasks.rake +4 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/comment.rb +6 -0
- data/test/dummy/app/models/post.rb +7 -0
- data/test/dummy/app/models/user.rb +13 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +39 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/counter_cache_patch.rb +19 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20120824210455_create_users.rb +10 -0
- data/test/dummy/db/migrate/20120824210731_create_comments.rb +11 -0
- data/test/dummy/db/migrate/20120824210927_create_posts.rb +13 -0
- data/test/dummy/db/schema.rb +43 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +498 -0
- data/test/dummy/log/test.log +224 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/fixtures/comments.yml +9 -0
- data/test/dummy/test/fixtures/posts.yml +13 -0
- data/test/dummy/test/fixtures/users.yml +9 -0
- data/test/dummy/test/unit/comment_test.rb +7 -0
- data/test/dummy/test/unit/post_test.rb +7 -0
- data/test/dummy/test/unit/user_test.rb +7 -0
- data/test/dummy/tmp/cache/26E/540/User%2F1 +0 -0
- data/test/dummy/tmp/cache/26F/550/User%2F2 +0 -0
- data/test/dummy/tmp/cache/270/560/User%2F3 +0 -0
- data/test/dummy/tmp/cache/271/570/User%2F4 +0 -0
- data/test/dummy/tmp/cache/272/580/User%2F5 +0 -0
- data/test/dummy/tmp/cache/273/590/User%2F6 +0 -0
- data/test/dummy/tmp/cache/275/6E0/Post%2F1 +0 -0
- data/test/dummy/tmp/cache/276/6F0/Post%2F2 +0 -0
- data/test/dummy/tmp/cache/277/700/Post%2F3 +0 -0
- data/test/dummy/tmp/cache/3A8/070/Comment%2F7 +0 -0
- data/test/dummy/tmp/cache/3A9/080/Comment%2F8 +0 -0
- data/test/dummy/tmp/cache/3AA/090/Comment%2F9 +0 -0
- data/test/dummy/tmp/cache/3D2/D30/Comment%2F10 +0 -0
- data/test/dummy/tmp/cache/3D4/D50/Comment%2F12 +0 -0
- data/test/dummy/tmp/cache/3D5/D60/Comment%2F13 +0 -0
- data/test/dummy/tmp/cache/3D6/D70/Comment%2F14 +0 -0
- data/test/dummy/tmp/cache/3D7/D80/Comment%2F15 +0 -0
- data/test/dummy/tmp/cache/58D/B70/Post%2Fuser_id-1 +1 -0
- data/test/find_cache_test.rb +51 -0
- data/test/test_helper.rb +15 -0
- metadata +261 -0
@@ -0,0 +1,224 @@
|
|
1
|
+
Connecting to database specified by database.yml
|
2
|
+
[1m[36m (0.5ms)[0m [1mbegin transaction[0m
|
3
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4
|
+
Connecting to database specified by database.yml
|
5
|
+
[1m[36m (0.6ms)[0m [1mbegin transaction[0m
|
6
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
7
|
+
Connecting to database specified by database.yml
|
8
|
+
Connecting to database specified by database.yml
|
9
|
+
Connecting to database specified by database.yml
|
10
|
+
Connecting to database specified by database.yml
|
11
|
+
Connecting to database specified by database.yml
|
12
|
+
Connecting to database specified by database.yml
|
13
|
+
Connecting to database specified by database.yml
|
14
|
+
Connecting to database specified by database.yml
|
15
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
16
|
+
[1m[35mSQL (23.1ms)[0m INSERT INTO "users" ("created_at", "email", "password", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 24 Aug 2012 21:42:47 UTC +00:00], ["email", "test@videofork.com"], ["password", "test1234"], ["updated_at", Fri, 24 Aug 2012 21:42:47 UTC +00:00]]
|
17
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "posts" ("body", "comments_count", "created_at", "title", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?)[0m [["body", nil], ["comments_count", nil], ["created_at", Fri, 24 Aug 2012 21:42:47 UTC +00:00], ["title", nil], ["updated_at", Fri, 24 Aug 2012 21:42:47 UTC +00:00], ["user_id", 1]]
|
18
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."user_id" = 1 LIMIT 1
|
19
|
+
[1m[36m (1.7ms)[0m [1mcommit transaction[0m
|
20
|
+
[1m[35mUser Load (0.3ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
|
21
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1[0m
|
22
|
+
Connecting to database specified by database.yml
|
23
|
+
Connecting to database specified by database.yml
|
24
|
+
Connecting to database specified by database.yml
|
25
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
26
|
+
[1m[35mPost Load (0.2ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
27
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
28
|
+
[1m[35mSQL (5.0ms)[0m INSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?) [["content", "test content for comment"], ["created_at", Fri, 24 Aug 2012 22:01:42 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:01:42 UTC +00:00]]
|
29
|
+
[1m[36m (0.8ms)[0m [1mrollback transaction[0m
|
30
|
+
[1m[35mPost Load (0.2ms)[0m SELECT "posts".* FROM "posts" LIMIT 1
|
31
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
32
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?) [["content", "test 1 content for comment"], ["created_at", Fri, 24 Aug 2012 22:01:42 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:01:42 UTC +00:00]]
|
33
|
+
[1m[36m (0.7ms)[0m [1mrollback transaction[0m
|
34
|
+
[1m[35mPost Load (0.2ms)[0m SELECT "posts".* FROM "posts" LIMIT 1
|
35
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
36
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
|
37
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
38
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "users" ("created_at", "email", "password", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 24 Aug 2012 22:01:42 UTC +00:00], ["email", "test@videofork.com"], ["password", "test1234"], ["updated_at", Fri, 24 Aug 2012 22:01:42 UTC +00:00]]
|
39
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "posts" ("body", "comments_count", "created_at", "title", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?)[0m [["body", nil], ["comments_count", nil], ["created_at", Fri, 24 Aug 2012 22:01:42 UTC +00:00], ["title", nil], ["updated_at", Fri, 24 Aug 2012 22:01:42 UTC +00:00], ["user_id", 2]]
|
40
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."user_id" = 2 LIMIT 1
|
41
|
+
[1m[36m (2.3ms)[0m [1mcommit transaction[0m
|
42
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
|
43
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1[0m
|
44
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" LIMIT 1
|
45
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts" WHERE "posts"."user_id" = 1 LIMIT 1[0m
|
46
|
+
[1m[35mPost Load (0.2ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."user_id" = 1 LIMIT 1
|
47
|
+
Connecting to database specified by database.yml
|
48
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
49
|
+
[1m[35m (0.1ms)[0m begin transaction
|
50
|
+
[1m[36mSQL (4.1ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test content for comment"], ["created_at", Fri, 24 Aug 2012 22:02:05 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:02:05 UTC +00:00]]
|
51
|
+
[1m[35m (0.9ms)[0m rollback transaction
|
52
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
53
|
+
[1m[35m (0.0ms)[0m begin transaction
|
54
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test 1 content for comment"], ["created_at", Fri, 24 Aug 2012 22:02:05 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:02:05 UTC +00:00]]
|
55
|
+
[1m[35m (0.6ms)[0m rollback transaction
|
56
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
57
|
+
[1m[35m (0.0ms)[0m begin transaction
|
58
|
+
[1m[36m (0.4ms)[0m [1mUPDATE "posts" SET "title" = 'test', "body" = 'hello world!', "updated_at" = '2012-08-24 22:02:05.031746' WHERE "posts"."id" = 1[0m
|
59
|
+
[1m[35m (1.6ms)[0m commit transaction
|
60
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1[0m
|
61
|
+
[1m[35mPost Load (0.2ms)[0m SELECT "posts".* FROM "posts" LIMIT 1
|
62
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1[0m
|
63
|
+
[1m[35m (0.1ms)[0m begin transaction
|
64
|
+
[1m[36mSQL (0.6ms)[0m [1mINSERT INTO "users" ("created_at", "email", "password", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Fri, 24 Aug 2012 22:02:05 UTC +00:00], ["email", "test@videofork.com"], ["password", "test1234"], ["updated_at", Fri, 24 Aug 2012 22:02:05 UTC +00:00]]
|
65
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "posts" ("body", "comments_count", "created_at", "title", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["comments_count", nil], ["created_at", Fri, 24 Aug 2012 22:02:05 UTC +00:00], ["title", nil], ["updated_at", Fri, 24 Aug 2012 22:02:05 UTC +00:00], ["user_id", 3]]
|
66
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts" WHERE "posts"."user_id" = 3 LIMIT 1[0m
|
67
|
+
[1m[35m (1.9ms)[0m commit transaction
|
68
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 3 LIMIT 1[0m
|
69
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 3 LIMIT 1
|
70
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" LIMIT 1[0m
|
71
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."user_id" = 1 LIMIT 1
|
72
|
+
Connecting to database specified by database.yml
|
73
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
74
|
+
[1m[35m (0.1ms)[0m begin transaction
|
75
|
+
[1m[36mSQL (4.6ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test content for comment"], ["created_at", Fri, 24 Aug 2012 22:02:50 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:02:50 UTC +00:00]]
|
76
|
+
[1m[35mPost Load (0.2ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
77
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1[0m
|
78
|
+
[1m[35m (2.7ms)[0m commit transaction
|
79
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1[0m
|
80
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
81
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
82
|
+
[1m[35m (0.0ms)[0m begin transaction
|
83
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test 1 content for comment"], ["created_at", Fri, 24 Aug 2012 22:02:50 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:02:50 UTC +00:00]]
|
84
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
85
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1[0m
|
86
|
+
[1m[35m (1.8ms)[0m commit transaction
|
87
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
88
|
+
[1m[35m (0.0ms)[0m begin transaction
|
89
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test 2 content for comment"], ["created_at", Fri, 24 Aug 2012 22:02:50 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:02:50 UTC +00:00]]
|
90
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
91
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1[0m
|
92
|
+
[1m[35m (2.1ms)[0m commit transaction
|
93
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
94
|
+
[1m[35m (0.1ms)[0m begin transaction
|
95
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test 3 content for comment"], ["created_at", Fri, 24 Aug 2012 22:02:50 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:02:50 UTC +00:00]]
|
96
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
97
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1[0m
|
98
|
+
[1m[35m (1.8ms)[0m commit transaction
|
99
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
100
|
+
[1m[35m (0.0ms)[0m begin transaction
|
101
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test 4 content for comment"], ["created_at", Fri, 24 Aug 2012 22:02:50 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:02:50 UTC +00:00]]
|
102
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
103
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1[0m
|
104
|
+
[1m[35m (2.2ms)[0m commit transaction
|
105
|
+
[1m[36mPost Load (0.3ms)[0m [1mSELECT "posts".* FROM "posts" WHERE "posts"."id" IN (2, 3, 4, 5)[0m
|
106
|
+
[1m[35mPost Load (0.3ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" IN (2, 3, 4, 5) ORDER BY id DESC
|
107
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
108
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
109
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
110
|
+
[1m[35m (0.0ms)[0m commit transaction
|
111
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1[0m
|
112
|
+
[1m[35mPost Load (0.3ms)[0m SELECT "posts".* FROM "posts" LIMIT 1
|
113
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1[0m
|
114
|
+
[1m[35m (0.1ms)[0m begin transaction
|
115
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "users" ("created_at", "email", "password", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Fri, 24 Aug 2012 22:02:50 UTC +00:00], ["email", "test@videofork.com"], ["password", "test1234"], ["updated_at", Fri, 24 Aug 2012 22:02:50 UTC +00:00]]
|
116
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "posts" ("body", "comments_count", "created_at", "title", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["comments_count", nil], ["created_at", Fri, 24 Aug 2012 22:02:50 UTC +00:00], ["title", nil], ["updated_at", Fri, 24 Aug 2012 22:02:50 UTC +00:00], ["user_id", 4]]
|
117
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts" WHERE "posts"."user_id" = 4 LIMIT 1[0m
|
118
|
+
[1m[35m (2.7ms)[0m commit transaction
|
119
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 4 LIMIT 1[0m
|
120
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 4 LIMIT 1
|
121
|
+
[1m[36mUser Load (0.3ms)[0m [1mSELECT "users".* FROM "users" LIMIT 1[0m
|
122
|
+
[1m[35mPost Load (0.3ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."user_id" = 1 LIMIT 1
|
123
|
+
Connecting to database specified by database.yml
|
124
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
125
|
+
[1m[35m (0.1ms)[0m begin transaction
|
126
|
+
[1m[36mSQL (4.2ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test content for comment"], ["created_at", Fri, 24 Aug 2012 22:04:15 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:04:15 UTC +00:00]]
|
127
|
+
[1m[35mPost Load (0.2ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
128
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1[0m
|
129
|
+
[1m[35m (2.5ms)[0m commit transaction
|
130
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1[0m
|
131
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
132
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
133
|
+
[1m[35m (0.0ms)[0m begin transaction
|
134
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test 1 content for comment"], ["created_at", Fri, 24 Aug 2012 22:04:15 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:04:15 UTC +00:00]]
|
135
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
136
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1[0m
|
137
|
+
[1m[35m (1.6ms)[0m commit transaction
|
138
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
139
|
+
[1m[35m (0.0ms)[0m begin transaction
|
140
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test 2 content for comment"], ["created_at", Fri, 24 Aug 2012 22:04:15 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:04:15 UTC +00:00]]
|
141
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
142
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1[0m
|
143
|
+
[1m[35m (1.6ms)[0m commit transaction
|
144
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
145
|
+
[1m[35m (0.0ms)[0m begin transaction
|
146
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test 3 content for comment"], ["created_at", Fri, 24 Aug 2012 22:04:15 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:04:15 UTC +00:00]]
|
147
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
148
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1[0m
|
149
|
+
[1m[35m (2.0ms)[0m commit transaction
|
150
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
151
|
+
[1m[35m (0.0ms)[0m begin transaction
|
152
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test 4 content for comment"], ["created_at", Fri, 24 Aug 2012 22:04:15 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:04:15 UTC +00:00]]
|
153
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
154
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1[0m
|
155
|
+
[1m[35m (1.8ms)[0m commit transaction
|
156
|
+
[1m[36mComment Load (0.3ms)[0m [1mSELECT "comments".* FROM "comments" WHERE "comments"."id" IN (7, 8, 9, 10)[0m
|
157
|
+
[1m[35mComment Load (0.3ms)[0m SELECT "comments".* FROM "comments" WHERE "comments"."id" IN (7, 8, 9, 10) ORDER BY id DESC
|
158
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
159
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
160
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
161
|
+
[1m[35m (0.1ms)[0m commit transaction
|
162
|
+
[1m[36mPost Load (0.3ms)[0m [1mSELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1[0m
|
163
|
+
[1m[35mPost Load (0.2ms)[0m SELECT "posts".* FROM "posts" LIMIT 1
|
164
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1[0m
|
165
|
+
[1m[35m (0.1ms)[0m begin transaction
|
166
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "users" ("created_at", "email", "password", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Fri, 24 Aug 2012 22:04:15 UTC +00:00], ["email", "test@videofork.com"], ["password", "test1234"], ["updated_at", Fri, 24 Aug 2012 22:04:15 UTC +00:00]]
|
167
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "posts" ("body", "comments_count", "created_at", "title", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["comments_count", nil], ["created_at", Fri, 24 Aug 2012 22:04:15 UTC +00:00], ["title", nil], ["updated_at", Fri, 24 Aug 2012 22:04:15 UTC +00:00], ["user_id", 5]]
|
168
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts" WHERE "posts"."user_id" = 5 LIMIT 1[0m
|
169
|
+
[1m[35m (2.2ms)[0m commit transaction
|
170
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 5 LIMIT 1[0m
|
171
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 5 LIMIT 1
|
172
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" LIMIT 1[0m
|
173
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."user_id" = 1 LIMIT 1
|
174
|
+
Connecting to database specified by database.yml
|
175
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
176
|
+
[1m[35m (0.1ms)[0m begin transaction
|
177
|
+
[1m[36mSQL (4.2ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test content for comment"], ["created_at", Fri, 24 Aug 2012 22:05:54 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:05:54 UTC +00:00]]
|
178
|
+
[1m[35mPost Load (0.2ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
179
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1[0m
|
180
|
+
[1m[35m (3.0ms)[0m commit transaction
|
181
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1[0m
|
182
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
183
|
+
[1m[36mPost Load (0.2ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
184
|
+
[1m[35m (0.0ms)[0m begin transaction
|
185
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test 1 content for comment"], ["created_at", Fri, 24 Aug 2012 22:05:54 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:05:54 UTC +00:00]]
|
186
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
187
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1[0m
|
188
|
+
[1m[35m (1.8ms)[0m commit transaction
|
189
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
190
|
+
[1m[35m (0.0ms)[0m begin transaction
|
191
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test 2 content for comment"], ["created_at", Fri, 24 Aug 2012 22:05:54 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:05:54 UTC +00:00]]
|
192
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
193
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1[0m
|
194
|
+
[1m[35m (1.9ms)[0m commit transaction
|
195
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
196
|
+
[1m[35m (0.0ms)[0m begin transaction
|
197
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test 3 content for comment"], ["created_at", Fri, 24 Aug 2012 22:05:54 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:05:54 UTC +00:00]]
|
198
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
199
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1[0m
|
200
|
+
[1m[35m (2.0ms)[0m commit transaction
|
201
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
202
|
+
[1m[35m (0.0ms)[0m begin transaction
|
203
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "test 4 content for comment"], ["created_at", Fri, 24 Aug 2012 22:05:54 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:05:54 UTC +00:00]]
|
204
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
205
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1[0m
|
206
|
+
[1m[35m (1.5ms)[0m commit transaction
|
207
|
+
[1m[36mComment Load (0.3ms)[0m [1mSELECT "comments".* FROM "comments" WHERE "comments"."id" IN (12, 13, 14, 15) ORDER BY id ASC[0m
|
208
|
+
[1m[35mComment Load (0.3ms)[0m SELECT "comments".* FROM "comments" WHERE "comments"."id" IN (12, 13, 14, 15) ORDER BY id ASC
|
209
|
+
[1m[36mPost Load (0.3ms)[0m [1mSELECT "posts".* FROM "posts" LIMIT 1[0m
|
210
|
+
[1m[35mPost Load (0.2ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
|
211
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
212
|
+
[1m[35m (0.1ms)[0m commit transaction
|
213
|
+
[1m[36mPost Load (0.3ms)[0m [1mSELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1[0m
|
214
|
+
[1m[35mPost Load (0.2ms)[0m SELECT "posts".* FROM "posts" LIMIT 1
|
215
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1[0m
|
216
|
+
[1m[35m (0.1ms)[0m begin transaction
|
217
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "users" ("created_at", "email", "password", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Fri, 24 Aug 2012 22:05:54 UTC +00:00], ["email", "test@videofork.com"], ["password", "test1234"], ["updated_at", Fri, 24 Aug 2012 22:05:54 UTC +00:00]]
|
218
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "posts" ("body", "comments_count", "created_at", "title", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["comments_count", nil], ["created_at", Fri, 24 Aug 2012 22:05:54 UTC +00:00], ["title", nil], ["updated_at", Fri, 24 Aug 2012 22:05:54 UTC +00:00], ["user_id", 6]]
|
219
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts" WHERE "posts"."user_id" = 6 LIMIT 1[0m
|
220
|
+
[1m[35m (2.5ms)[0m commit transaction
|
221
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 6 LIMIT 1[0m
|
222
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 6 LIMIT 1
|
223
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" LIMIT 1[0m
|
224
|
+
[1m[35mPost Load (0.3ms)[0m SELECT "posts".* FROM "posts" WHERE "posts"."user_id" = 1 LIMIT 1
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</html>
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1345845702.720623:@value" i
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require 'test_helper'
|
3
|
+
|
4
|
+
class FindCacheTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
# record test
|
7
|
+
def test_user_find_by_id_should_be_find_cache
|
8
|
+
user = User.create email: "test@videofork.com", password: "test1234"
|
9
|
+
id = user.id
|
10
|
+
assert_equal User.find_by_id(id), User.find_cache(id)
|
11
|
+
end
|
12
|
+
|
13
|
+
# find_cache_has_one test
|
14
|
+
def test_user_post_should_be_user_post_cache
|
15
|
+
user = User.first
|
16
|
+
assert_equal user.post, user.post_cache
|
17
|
+
end
|
18
|
+
|
19
|
+
# find_cache_belongs_to test
|
20
|
+
def test_post_user_should_be_post_user_cache
|
21
|
+
post = Post.first
|
22
|
+
assert_equal post.user, post.user_cache
|
23
|
+
end
|
24
|
+
|
25
|
+
# record update test
|
26
|
+
def test_post_update_should_expire_the_post_cache
|
27
|
+
post = Post.first
|
28
|
+
Post.find_cache(post.id) # to cache the post
|
29
|
+
post.update_attributes(title: "test", body: "hello world!")
|
30
|
+
assert_equal post, Post.find_cache(post.id)
|
31
|
+
end
|
32
|
+
|
33
|
+
# counter cache fix test
|
34
|
+
def test_after_adding_comment_post_should_expire_the_post_cache
|
35
|
+
post = Post.first
|
36
|
+
Post.find_cache(post.id) # to cache the post
|
37
|
+
Comment.create post_id: post.id, content: "test content for comment"
|
38
|
+
assert_equal Post.find_by_id(post.id), Post.find_cache(post.id)
|
39
|
+
end
|
40
|
+
|
41
|
+
# find_all_cache test
|
42
|
+
def test_find_all_by_id_should_be_find_all_cache
|
43
|
+
c1 = Comment.create post_id: Post.first.id, content: "test 1 content for comment"
|
44
|
+
c2 = Comment.create post_id: Post.first.id, content: "test 2 content for comment"
|
45
|
+
c3 = Comment.create post_id: Post.first.id, content: "test 3 content for comment"
|
46
|
+
c4 = Comment.create post_id: Post.first.id, content: "test 4 content for comment"
|
47
|
+
ids = [c1.id, c2.id, c3.id, c4.id]
|
48
|
+
assert_equal Comment.order("id ASC").find_all_by_id(ids), Comment.find_all_cache(ids, "id ASC")
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|