marks 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +1 -1
- data/lib/marks/marker.rb +6 -0
- data/lib/marks/version.rb +1 -1
- data/test/dummy/log/test.log +192 -0
- data/test/marks_test.rb +6 -0
- metadata +4 -4
data/MIT-LICENSE
CHANGED
data/lib/marks/marker.rb
CHANGED
@@ -22,6 +22,12 @@ module Marks
|
|
22
22
|
raise ArgumentError unless types.map { |t| t.to_s.classify }.include?(classified_mark)
|
23
23
|
outgoing_marks.where(mark_type: classified_mark, markable_type: markable.class.table_name.classify, markable_id: markable).any?
|
24
24
|
end
|
25
|
+
|
26
|
+
define_method :'unmarks' do |markable, mark|
|
27
|
+
classified_mark = mark.to_s.classify
|
28
|
+
raise ArgumentError unless types.map { |t| t.to_s.classify }.include?(classified_mark)
|
29
|
+
outgoing_marks.where(mark_type: classified_mark, markable_type: markable.class.table_name.classify, markable_id: markable).delete_all
|
30
|
+
end
|
25
31
|
end
|
26
32
|
end
|
27
33
|
end
|
data/lib/marks/version.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -1201,3 +1201,195 @@ Connecting to database specified by database.yml
|
|
1201
1201
|
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1202
1202
|
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "marks_marks" WHERE "marks_marks"."marker_id" = 1 AND "marks_marks"."marker_type" = 'User' AND "marks_marks"."mark_type" = 'Nice' AND "marks_marks"."markable_type" = 'Reply' AND "marks_marks"."markable_id" = 1[0m
|
1203
1203
|
[1m[35m (1.0ms)[0m rollback transaction
|
1204
|
+
Connecting to database specified by database.yml
|
1205
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
1206
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1207
|
+
[1m[36mSQL (9.8ms)[0m [1mINSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", Wed, 05 Dec 2012 06:16:49 UTC +00:00], ["updated_at", Wed, 05 Dec 2012 06:16:49 UTC +00:00]]
|
1208
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
1209
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1210
|
+
[1m[35mSQL (0.9ms)[0m INSERT INTO "replies" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Wed, 05 Dec 2012 06:16:49 UTC +00:00], ["updated_at", Wed, 05 Dec 2012 06:16:49 UTC +00:00]]
|
1211
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1212
|
+
[1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "users" INNER JOIN "marks_marks" ON "marks_marks"."marker_id" = "users"."id" AND "marks_marks"."marker_type" = 'User' WHERE (marks_marks.mark_type = 'Nice' AND markable_type = 'Reply' AND markable_id = 1)
|
1213
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1214
|
+
[1m[35mSQL (0.8ms)[0m INSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Wed, 05 Dec 2012 06:16:49 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Wed, 05 Dec 2012 06:16:49 UTC +00:00]]
|
1215
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1216
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1217
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Wed, 05 Dec 2012 06:16:49 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Wed, 05 Dec 2012 06:16:49 UTC +00:00]]
|
1218
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1219
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1220
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Wed, 05 Dec 2012 06:16:49 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Wed, 05 Dec 2012 06:16:49 UTC +00:00]]
|
1221
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1222
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" INNER JOIN "marks_marks" ON "marks_marks"."marker_id" = "users"."id" AND "marks_marks"."marker_type" = 'User' WHERE (marks_marks.mark_type = 'Nice' AND markable_type = 'Reply' AND markable_id = 1)
|
1223
|
+
[1m[36m (1.0ms)[0m [1mrollback transaction[0m
|
1224
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1225
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1226
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Wed, 05 Dec 2012 06:16:49 UTC +00:00], ["updated_at", Wed, 05 Dec 2012 06:16:49 UTC +00:00]]
|
1227
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1228
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1229
|
+
[1m[36mSQL (0.6ms)[0m [1mINSERT INTO "replies" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", Wed, 05 Dec 2012 06:16:49 UTC +00:00], ["updated_at", Wed, 05 Dec 2012 06:16:49 UTC +00:00]]
|
1230
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
1231
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "marks_marks" WHERE "marks_marks"."marker_id" = 1 AND "marks_marks"."marker_type" = 'User' AND "marks_marks"."mark_type" = 'Nice' AND "marks_marks"."markable_type" = 'Reply' AND "marks_marks"."markable_id" = 1[0m
|
1232
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1233
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Wed, 05 Dec 2012 06:16:49 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Wed, 05 Dec 2012 06:16:49 UTC +00:00]]
|
1234
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1235
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "marks_marks" WHERE "marks_marks"."marker_id" = 1 AND "marks_marks"."marker_type" = 'User' AND "marks_marks"."mark_type" = 'Nice' AND "marks_marks"."markable_type" = 'Reply' AND "marks_marks"."markable_id" = 1[0m
|
1236
|
+
[1m[35m (0.5ms)[0m rollback transaction
|
1237
|
+
Connecting to database specified by database.yml
|
1238
|
+
[1m[36m (0.4ms)[0m [1mbegin transaction[0m
|
1239
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
1240
|
+
[1m[36mSQL (8.9ms)[0m [1mINSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00]]
|
1241
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
1242
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1243
|
+
[1m[35mSQL (0.9ms)[0m INSERT INTO "replies" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00]]
|
1244
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1245
|
+
[1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "users" INNER JOIN "marks_marks" ON "marks_marks"."marker_id" = "users"."id" AND "marks_marks"."marker_type" = 'User' WHERE (marks_marks.mark_type = 'Nice' AND markable_type = 'Reply' AND markable_id = 1)
|
1246
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1247
|
+
[1m[35mSQL (1.5ms)[0m INSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00]]
|
1248
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1249
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
1250
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00]]
|
1251
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
1252
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1253
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00]]
|
1254
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1255
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" INNER JOIN "marks_marks" ON "marks_marks"."marker_id" = "users"."id" AND "marks_marks"."marker_type" = 'User' WHERE (marks_marks.mark_type = 'Nice' AND markable_type = 'Reply' AND markable_id = 1)
|
1256
|
+
[1m[36m (0.9ms)[0m [1mrollback transaction[0m
|
1257
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1258
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1259
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00]]
|
1260
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1261
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1262
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "replies" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00]]
|
1263
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1264
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "marks_marks" WHERE "marks_marks"."marker_id" = 1 AND "marks_marks"."marker_type" = 'User' AND "marks_marks"."mark_type" = 'Nice' AND "marks_marks"."markable_type" = 'Reply' AND "marks_marks"."markable_id" = 1[0m
|
1265
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1266
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00]]
|
1267
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1268
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "marks_marks" WHERE "marks_marks"."marker_id" = 1 AND "marks_marks"."marker_type" = 'User' AND "marks_marks"."mark_type" = 'Nice' AND "marks_marks"."markable_type" = 'Reply' AND "marks_marks"."markable_id" = 1[0m
|
1269
|
+
[1m[35m (0.5ms)[0m rollback transaction
|
1270
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1271
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1272
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00]]
|
1273
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1274
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1275
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "replies" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00]]
|
1276
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1277
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1278
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00]]
|
1279
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1280
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1281
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00]]
|
1282
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1283
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1284
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:36:55 UTC +00:00]]
|
1285
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1286
|
+
[1m[36mSQL (0.1ms)[0m [1mDELETE FROM "marks_marks" WHERE "marks_marks"."marker_id" = 1 AND "marks_marks"."marker_type" = 'User' AND "marks_marks"."mark_type" = 'Nice' AND "marks_marks"."markable_type" = 'Reply' AND "marks_marks"."markable_id" = 1[0m
|
1287
|
+
[1m[35m (0.2ms)[0m SELECT COUNT(*) FROM "marks_marks" WHERE "marks_marks"."marker_id" = 1 AND "marks_marks"."marker_type" = 'User' AND "marks_marks"."mark_type" = 'Nice' AND "marks_marks"."markable_type" = 'Reply' AND "marks_marks"."markable_id" = 1
|
1288
|
+
[1m[36m (0.5ms)[0m [1mrollback transaction[0m
|
1289
|
+
Connecting to database specified by database.yml
|
1290
|
+
[1m[36m (0.4ms)[0m [1mbegin transaction[0m
|
1291
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1292
|
+
[1m[36mSQL (4.9ms)[0m [1mINSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00]]
|
1293
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
1294
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1295
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "replies" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00]]
|
1296
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1297
|
+
[1m[35m (0.2ms)[0m SELECT COUNT(*) FROM "users" INNER JOIN "marks_marks" ON "marks_marks"."marker_id" = "users"."id" AND "marks_marks"."marker_type" = 'User' WHERE (marks_marks.mark_type = 'Nice' AND markable_type = 'Reply' AND markable_id = 1)
|
1298
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1299
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00]]
|
1300
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1301
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1302
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00]]
|
1303
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1304
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1305
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00]]
|
1306
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1307
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" INNER JOIN "marks_marks" ON "marks_marks"."marker_id" = "users"."id" AND "marks_marks"."marker_type" = 'User' WHERE (marks_marks.mark_type = 'Nice' AND markable_type = 'Reply' AND markable_id = 1)
|
1308
|
+
[1m[36m (0.5ms)[0m [1mrollback transaction[0m
|
1309
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1310
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1311
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00]]
|
1312
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1313
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1314
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "replies" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00]]
|
1315
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1316
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "marks_marks" WHERE "marks_marks"."marker_id" = 1 AND "marks_marks"."marker_type" = 'User' AND "marks_marks"."mark_type" = 'Nice' AND "marks_marks"."markable_type" = 'Reply' AND "marks_marks"."markable_id" = 1[0m
|
1317
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
1318
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00]]
|
1319
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1320
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "marks_marks" WHERE "marks_marks"."marker_id" = 1 AND "marks_marks"."marker_type" = 'User' AND "marks_marks"."mark_type" = 'Nice' AND "marks_marks"."markable_type" = 'Reply' AND "marks_marks"."markable_id" = 1[0m
|
1321
|
+
[1m[35m (0.5ms)[0m rollback transaction
|
1322
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1323
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1324
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00]]
|
1325
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
1326
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1327
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "replies" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00]]
|
1328
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1329
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1330
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00]]
|
1331
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1332
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1333
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00]]
|
1334
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1335
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1336
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:37:18 UTC +00:00]]
|
1337
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1338
|
+
[1m[36mSQL (0.2ms)[0m [1mDELETE FROM "marks_marks" WHERE "marks_marks"."marker_id" = 1 AND "marks_marks"."marker_type" = 'User' AND "marks_marks"."mark_type" = 'Nice' AND "marks_marks"."markable_type" = 'Reply' AND "marks_marks"."markable_id" = 1[0m
|
1339
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" INNER JOIN "marks_marks" ON "marks_marks"."marker_id" = "users"."id" AND "marks_marks"."marker_type" = 'User' WHERE (marks_marks.mark_type = 'Nice' AND markable_type = 'Reply' AND markable_id = 1)
|
1340
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "marks_marks" WHERE "marks_marks"."marker_id" = 1 AND "marks_marks"."marker_type" = 'User' AND "marks_marks"."mark_type" = 'Nice' AND "marks_marks"."markable_type" = 'Reply' AND "marks_marks"."markable_id" = 1[0m
|
1341
|
+
[1m[35m (0.5ms)[0m rollback transaction
|
1342
|
+
Connecting to database specified by database.yml
|
1343
|
+
[1m[36m (0.4ms)[0m [1mbegin transaction[0m
|
1344
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
1345
|
+
[1m[36mSQL (7.4ms)[0m [1mINSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00]]
|
1346
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1347
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1348
|
+
[1m[35mSQL (0.6ms)[0m INSERT INTO "replies" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00]]
|
1349
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1350
|
+
[1m[35m (0.2ms)[0m SELECT COUNT(*) FROM "users" INNER JOIN "marks_marks" ON "marks_marks"."marker_id" = "users"."id" AND "marks_marks"."marker_type" = 'User' WHERE (marks_marks.mark_type = 'Nice' AND markable_type = 'Reply' AND markable_id = 1)
|
1351
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1352
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00]]
|
1353
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1354
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1355
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00]]
|
1356
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1357
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1358
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00]]
|
1359
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1360
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" INNER JOIN "marks_marks" ON "marks_marks"."marker_id" = "users"."id" AND "marks_marks"."marker_type" = 'User' WHERE (marks_marks.mark_type = 'Nice' AND markable_type = 'Reply' AND markable_id = 1)
|
1361
|
+
[1m[36m (0.5ms)[0m [1mrollback transaction[0m
|
1362
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1363
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1364
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00]]
|
1365
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1366
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1367
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "replies" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00]]
|
1368
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1369
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "marks_marks" WHERE "marks_marks"."marker_id" = 1 AND "marks_marks"."marker_type" = 'User' AND "marks_marks"."mark_type" = 'Nice' AND "marks_marks"."markable_type" = 'Reply' AND "marks_marks"."markable_id" = 1[0m
|
1370
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
1371
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00]]
|
1372
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1373
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "marks_marks" WHERE "marks_marks"."marker_id" = 1 AND "marks_marks"."marker_type" = 'User' AND "marks_marks"."mark_type" = 'Nice' AND "marks_marks"."markable_type" = 'Reply' AND "marks_marks"."markable_id" = 1[0m
|
1374
|
+
[1m[35m (0.3ms)[0m rollback transaction
|
1375
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1376
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1377
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00]]
|
1378
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1379
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1380
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "replies" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00], ["updated_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00]]
|
1381
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1382
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1383
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00]]
|
1384
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1385
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1386
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00]]
|
1387
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1388
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1389
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "marks_marks" ("created_at", "mark_type", "markable_id", "markable_type", "marker_id", "marker_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00], ["mark_type", "Nice"], ["markable_id", 1], ["markable_type", "Reply"], ["marker_id", 1], ["marker_type", "User"], ["updated_at", Thu, 17 Jan 2013 09:37:27 UTC +00:00]]
|
1390
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1391
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" INNER JOIN "marks_marks" ON "marks_marks"."marker_id" = "users"."id" AND "marks_marks"."marker_type" = 'User' WHERE (marks_marks.mark_type = 'Nice' AND markable_type = 'Reply' AND markable_id = 1)[0m
|
1392
|
+
[1m[35mSQL (0.2ms)[0m DELETE FROM "marks_marks" WHERE "marks_marks"."marker_id" = 1 AND "marks_marks"."marker_type" = 'User' AND "marks_marks"."mark_type" = 'Nice' AND "marks_marks"."markable_type" = 'Reply' AND "marks_marks"."markable_id" = 1
|
1393
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" INNER JOIN "marks_marks" ON "marks_marks"."marker_id" = "users"."id" AND "marks_marks"."marker_type" = 'User' WHERE (marks_marks.mark_type = 'Nice' AND markable_type = 'Reply' AND markable_id = 1)[0m
|
1394
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "marks_marks" WHERE "marks_marks"."marker_id" = 1 AND "marks_marks"."marker_type" = 'User' AND "marks_marks"."mark_type" = 'Nice' AND "marks_marks"."markable_type" = 'Reply' AND "marks_marks"."markable_id" = 1
|
1395
|
+
[1m[36m (0.4ms)[0m [1mrollback transaction[0m
|
data/test/marks_test.rb
CHANGED
@@ -19,4 +19,10 @@ class MarksTest < ActiveSupport::TestCase
|
|
19
19
|
assert_equal [@user, @user, @user], @reply.markers(:user, :nice)
|
20
20
|
assert_raise(ArgumentError) { @reply.markers(:user, :unknown_mark) }
|
21
21
|
end
|
22
|
+
|
23
|
+
test '#unmarks' do
|
24
|
+
3.times { @user.marks(@reply, :nice) }
|
25
|
+
@user.unmarks(@reply, :nice)
|
26
|
+
assert !@user.marks?(@reply, :nice)
|
27
|
+
end
|
22
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -115,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
115
115
|
version: '0'
|
116
116
|
segments:
|
117
117
|
- 0
|
118
|
-
hash:
|
118
|
+
hash: 692714029956290424
|
119
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
120
|
none: false
|
121
121
|
requirements:
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
version: '0'
|
125
125
|
segments:
|
126
126
|
- 0
|
127
|
-
hash:
|
127
|
+
hash: 692714029956290424
|
128
128
|
requirements: []
|
129
129
|
rubyforge_project:
|
130
130
|
rubygems_version: 1.8.23
|