test/dummy/log/test.log in advert_selector-1.0.4 vs test/dummy/log/test.log in advert_selector-2.0.0
- old
+ new
@@ -99285,5 +99285,12289 @@
[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
[AdvertSelector] AdvertSelection finished
Completed 200 OK in 7ms (Views: 6.0ms | ActiveRecord: 0.4ms)
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
+Connecting to database specified by database.yml
+ [1m[36m (0.3ms)[0m [1mbegin transaction[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_placements"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Parade', 'leaderboard,video', '2014-02-11 18:30:28', '2014-02-11 18:30:28', 718799085)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Leaderboard', 'parade', '2014-02-11 18:30:28', '2014-02-11 18:30:28', 405688915)
+ [1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "only_once_per_session", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Video', 't', 'parade', '2014-02-11 18:30:28', '2014-02-11 18:30:28', 1019730477)[0m
+ [1m[35mFixture Delete (0.0ms)[0m DELETE FROM "advert_selector_banners"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "running_view_count", "frequency", "fast_mode", "comment", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Coke', '2014-02-06 00:00:00.000000', '2014-02-16 00:00:00.000000', 1000, 100, 0, 'f', 'Coke banner', 't', 50, '2014-02-11 18:30:28', '2014-02-11 18:30:28', 814558298, 405688915)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "comment", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Pepsi', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 0, 'Pepsi banner', 't', 't', 100, '2014-02-11 18:30:28', '2014-02-11 18:30:28', 394627963, 405688915)
+ [1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('parade_banner', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 1, 't', 'f', 1000, '2014-02-11 18:30:28', '2014-02-11 18:30:28', 207249520, 718799085)[0m
+ [1m[35mFixture Delete (0.0ms)[0m DELETE FROM "advert_selector_helper_items"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "position", "created_at", "updated_at", "id", "banner_id") VALUES ('banner_leaderboard', 't', '<img src=''coke_banner''/>', 1, '2014-02-11 18:30:28', '2014-02-11 18:30:28', 929640376, 814558298)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES ('request_params_include?', 'f', 'pepsi=true', '2014-02-11 18:30:28', '2014-02-11 18:30:28', 435138789, 394627963)
+ [1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (2, 'banner_leaderboard', 't', '<img src=''pepsi_banner''/>', '2014-02-11 18:30:28', '2014-02-11 18:30:28', 960656439, 394627963)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (1, 'banner_parade', 't', '<img src=''banner_parade''/>', '2014-02-11 18:30:28', '2014-02-11 18:30:28', 281932184, 207249520)
+ [1m[36m (35.2ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (1.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE ("advert_selector_helper_items"."banner_id" = 814558298) ORDER BY advert_selector_helper_items.position DESC LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content", nil], ["content_for", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", nil], ["position", 2], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 10)
+ [1m[36mSQL (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content", nil], ["content_for", true], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "content_for_invalid"], ["position", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content", nil], ["content_for", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "some_limit_helper_here"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 960656440]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position > 3)
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_helper_items" [0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position LIMIT 1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position DESC LIMIT 1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000074' OR end_time IS NULL)[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000628' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.000725' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.001336' OR end_time IS NULL)[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.001769' OR end_time IS NULL) AND (start_time < '2013-02-11 11:00:00.001863' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 0, "updated_at" = '2014-02-11 10:00:00.000552' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 551, "updated_at" = '2014-02-11 10:00:00.004424' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 0, "target_view_count" = 10, "updated_at" = '2014-02-11 10:00:00.000530' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 10, "updated_at" = '2014-02-11 10:00:00.002527' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.000266' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 't', "updated_at" = '2014-02-11 10:00:00.001812' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "start_time" = '2014-02-11 11:00:00.000251', "updated_at" = '2014-02-11 10:00:00.000545' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "start_time" = '2014-02-11 08:00:00.001594', "end_time" = '2014-02-11 09:00:00.001654', "updated_at" = '2014-02-11 10:00:00.001913' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = NULL, "end_time" = '2014-02-11 11:00:00.002664', "updated_at" = '2014-02-11 10:00:00.002883' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = '2014-02-10 22:00:00.000000', "end_time" = '2014-02-15 14:00:00.000000', "updated_at" = '2014-02-11 10:00:00.000517' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 0, "updated_at" = '2014-02-11 10:00:00.001701' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = '2014-02-10 22:00:00.000000', "end_time" = '2014-02-21 00:00:00.000000', "updated_at" = '2014-02-11 10:00:00.000507' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 0, "updated_at" = '2014-02-11 10:00:00.001739' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = '2014-02-11 16:00:00.000000', "updated_at" = '2014-02-11 17:00:00.000931' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "start_time" = '2014-02-10 22:00:00.000000', "end_time" = '2014-02-15 14:00:00.000000', "updated_at" = '2014-02-11 10:00:00.000492' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 0, "updated_at" = '2014-02-11 10:00:00.001722' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" [0m
+Processing by AdvertSelector::BannersController#create as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner", "end_time"=>"2014-02-21 00:00:00 UTC", "frequency"=>"0", "name"=>"Pepsi", "placement_id"=>"405688915", "start_time"=>"2014-02-11 00:00:00 UTC", "target_view_count"=>"1000"}}
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "advert_selector_banners" ("comment", "confirmed", "created_at", "end_time", "fast_mode", "frequency", "name", "placement_id", "priority", "running_view_count", "start_time", "target_view_count", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[0m [["comment", "Pepsi banner"], ["confirmed", false], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["end_time", Fri, 21 Feb 2014 00:00:00 UTC +00:00], ["fast_mode", false], ["frequency", 0], ["name", "Pepsi"], ["placement_id", 405688915], ["priority", 0], ["running_view_count", 0], ["start_time", Tue, 11 Feb 2014 00:00:00 UTC +00:00], ["target_view_count", 1000], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558299 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/advert_selector/banners/814558299
+Completed 302 Found in 5ms (ActiveRecord: 0.5ms)
+ [1m[35m (0.0ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#destroy as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 435138789]]
+ [1m[36mSQL (0.0ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 960656439]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 394627963 AND position > 2)
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ?[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners
+Completed 302 Found in 3ms (ActiveRecord: 0.5ms)
+ [1m[36m (0.0ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" [0m
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#edit as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (130.5ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.162971') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 186ms (Views: 184.0ms | ActiveRecord: 0.9ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" [0m
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.005684') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 8ms (Views: 7.2ms | ActiveRecord: 0.5ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (12.2ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.016076') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 19ms (Views: 17.4ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#show as HTML
+ Parameters: {"id"=>"394627963"}
+Redirected to http://test.host/advert_selector/banners/394627963/edit
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#update as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 2ms (ActiveRecord: 0.2ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 1, "updated_at" = '2014-02-11 10:00:00.000768' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1
+Processing by AdvertSelector::BannersController#update_running_view_count as HTML
+ Parameters: {"banner"=>{"running_view_count"=>"99"}, "id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mSQL (0.4ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963[0m
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 1073ms (ActiveRecord: 0.6ms)
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.2ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+Filter chain halted as :admin_access_only rendered or redirected
+Completed 403 Forbidden in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#clear_errors_log as HTML
+Redirected to http://test.host/advert_selector/
+Completed 302 Found in 25ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.003594') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.4ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = 'not_found,video', "updated_at" = '2014-02-11 10:00:00.001326' WHERE "advert_selector_placements"."id" = 718799085
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') LIMIT 1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = '', "updated_at" = '2014-02-11 10:00:00.002671' WHERE "advert_selector_placements"."id" = 405688915
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'not_found' LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'video' LIMIT 1[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_placements"
+Processing by AdvertSelector::PlacementsController#create as HTML
+ Parameters: {"placement"=>{"name"=>"new placement"}}
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m INSERT INTO "advert_selector_placements" ("conflicting_placements_array", "created_at", "name", "only_once_per_session", "updated_at") VALUES (?, ?, ?, ?, ?) [["conflicting_placements_array", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "new placement"], ["only_once_per_session", nil], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/advert_selector/placements/1019730478
+Completed 302 Found in 3ms (ActiveRecord: 0.3ms)
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_placements"
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements" [0m
+Processing by AdvertSelector::PlacementsController#destroy as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/advert_selector/placements
+Completed 302 Found in 2ms (ActiveRecord: 0.2ms)
+ [1m[35m (0.0ms)[0m SELECT COUNT(*) FROM "advert_selector_placements"
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#edit as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", "405688915"]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') LIMIT 1[0m
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (5.6ms)
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.013696') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 15ms (Views: 12.6ms | ActiveRecord: 0.8ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.005742') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 8ms (Views: 6.6ms | ActiveRecord: 0.5ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#new as HTML
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = '') LIMIT 1[0m
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (4.0ms)
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.008184') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 11ms (Views: 9.7ms | ActiveRecord: 0.6ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#show as HTML
+ Parameters: {"id"=>"405688915"}
+Redirected to http://test.host/advert_selector/placements/405688915/edit
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#update as HTML
+ Parameters: {"placement"=>{"name"=>"Leaderboard"}, "id"=>"405688915"}
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", "405688915"]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/advert_selector/placements/405688915
+Completed 302 Found in 2ms (ActiveRecord: 0.1ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000952' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003098' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+
+
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.010800' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.011028' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 31ms (Views: 30.5ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)[0m
+ [1m[35mSQL (0.2ms)[0m INSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["banner_id", 814558298], ["content", nil], ["content_for", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "always_false"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+
+
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.044372' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.044517' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.3ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000857' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003046' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content", nil], ["content_for", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "raise_error"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+
+
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007098' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007270' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Error with banner Coke in placement Leaderboard.
+2014-02-11T12:00:00+02:00 - http://www.example.com/ - {"controller"=>"examples", "action"=>"index"}
+#<ZeroDivisionError: divided by 0>
+
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `/'
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `advert_selector_raise_error'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:53:in `block in advert_selector_banner_try'
+/home/ohu/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.8/lib/active_record/associations/collection_proxy.rb:89:in `each'
+/home/ohu/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.8/lib/active_record/associations/collection_proxy.rb:89:in `method_missing'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:49:in `advert_selector_banner_try'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:20:in `block (2 levels) in advert_selector_initialize'
+/home/ohu/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.8/lib/active_record/relation/delegation.rb:6:in `each'
+/home/ohu/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.8/lib/active_record/relation/delegation.rb:6:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:18:in `block in advert_selector_initialize'
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.4ms | ActiveRecord: 0.3ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+
+
+Started GET "/advert_selector/placements" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.019540') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mCACHE (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mCACHE (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 56ms (Views: 55.1ms | ActiveRecord: 0.4ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000889' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003159' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "frequency" = 2, "updated_at" = '2014-02-11 10:00:00.004360' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+
+
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.006574' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.006747' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.3ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+
+
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-14 10:00:00.014142' OR end_time IS NULL) AND (start_time < '2014-02-14 11:00:00.014311' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+
+
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001075' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003554' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+
+
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.006868' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007075' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+
+
+Started GET "/?advert_selector_force=207249520&advert_selector_force_stamp=1392076800" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+ Parameters: {"advert_selector_force"=>"207249520", "advert_selector_force_stamp"=>"1392076800"}
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = 207249520 LIMIT 1[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 ORDER BY position[0m
+[AdvertSelector] ForceShowing banner parade_banner in placement Parade
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.017821' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.017991' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.6ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000889' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003036' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 't', "updated_at" = '2014-02-11 10:00:00.004401' WHERE "advert_selector_banners"."id" = 207249520
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+
+
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007480' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007654' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+
+
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000848' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.002897' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 't', "updated_at" = '2014-02-11 10:00:00.004265' WHERE "advert_selector_banners"."id" = 207249520
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = '', "updated_at" = '2014-02-11 10:00:00.005936' WHERE "advert_selector_placements"."id" = 718799085[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') LIMIT 1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = '', "updated_at" = '2014-02-11 10:00:00.006870' WHERE "advert_selector_placements"."id" = 405688915[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'video') LIMIT 1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = '', "updated_at" = '2014-02-11 10:00:00.008115' WHERE "advert_selector_placements"."id" = 1019730477
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') LIMIT 1[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+
+
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.010779' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.010945' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.3ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000979' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003313' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+
+
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.004679' OR end_time IS NULL) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.3ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+
+
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
+
+
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:15:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1ms (Views: 1.4ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.025184' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.027800' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_placements" SET "only_once_per_session" = 't', "updated_at" = '2014-02-11 10:00:00.029556' WHERE "advert_selector_placements"."id" = 405688915
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+
+
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.031819' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.031993' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+
+
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.001754' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.001916' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.4ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+Connecting to database specified by database.yml
+ [1m[36m (0.3ms)[0m [1mbegin transaction[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_placements"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Parade', 'leaderboard,video', '2014-02-11 18:31:51', '2014-02-11 18:31:51', 718799085)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Leaderboard', 'parade', '2014-02-11 18:31:51', '2014-02-11 18:31:51', 405688915)
+ [1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "only_once_per_session", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Video', 't', 'parade', '2014-02-11 18:31:51', '2014-02-11 18:31:51', 1019730477)[0m
+ [1m[35mFixture Delete (0.0ms)[0m DELETE FROM "advert_selector_banners"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "running_view_count", "frequency", "fast_mode", "comment", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Coke', '2014-02-06 00:00:00.000000', '2014-02-16 00:00:00.000000', 1000, 100, 0, 'f', 'Coke banner', 't', 50, '2014-02-11 18:31:51', '2014-02-11 18:31:51', 814558298, 405688915)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "comment", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Pepsi', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 0, 'Pepsi banner', 't', 't', 100, '2014-02-11 18:31:51', '2014-02-11 18:31:51', 394627963, 405688915)
+ [1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('parade_banner', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 1, 't', 'f', 1000, '2014-02-11 18:31:51', '2014-02-11 18:31:51', 207249520, 718799085)[0m
+ [1m[35mFixture Delete (0.0ms)[0m DELETE FROM "advert_selector_helper_items"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "position", "created_at", "updated_at", "id", "banner_id") VALUES ('banner_leaderboard', 't', '<img src=''coke_banner''/>', 1, '2014-02-11 18:31:51', '2014-02-11 18:31:51', 929640376, 814558298)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES ('request_params_include?', 'f', 'pepsi=true', '2014-02-11 18:31:51', '2014-02-11 18:31:51', 435138789, 394627963)
+ [1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (2, 'banner_leaderboard', 't', '<img src=''pepsi_banner''/>', '2014-02-11 18:31:51', '2014-02-11 18:31:51', 960656439, 394627963)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (1, 'banner_parade', 't', '<img src=''banner_parade''/>', '2014-02-11 18:31:51', '2014-02-11 18:31:51', 281932184, 207249520)
+ [1m[36m (43.9ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (1.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[35m (0.1ms)[0m begin transaction
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction
+ [1m[36m (0.3ms)[0m [1mbegin transaction[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_placements"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Parade', 'leaderboard,video', '2014-02-11 18:38:47', '2014-02-11 18:38:47', 718799085)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Leaderboard', 'parade', '2014-02-11 18:38:47', '2014-02-11 18:38:47', 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "only_once_per_session", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Video', 't', 'parade', '2014-02-11 18:38:47', '2014-02-11 18:38:47', 1019730477)[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_banners"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "running_view_count", "frequency", "fast_mode", "comment", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Coke', '2014-02-06 00:00:00.000000', '2014-02-16 00:00:00.000000', 1000, 100, 0, 'f', 'Coke banner', 't', 50, '2014-02-11 18:38:47', '2014-02-11 18:38:47', 814558298, 405688915)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "comment", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Pepsi', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 0, 'Pepsi banner', 't', 't', 100, '2014-02-11 18:38:47', '2014-02-11 18:38:47', 394627963, 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('parade_banner', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 1, 't', 'f', 1000, '2014-02-11 18:38:47', '2014-02-11 18:38:47', 207249520, 718799085)[0m
+ [1m[35mFixture Delete (0.0ms)[0m DELETE FROM "advert_selector_helper_items"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "position", "created_at", "updated_at", "id", "banner_id") VALUES ('banner_leaderboard', 't', '<img src=''coke_banner''/>', 1, '2014-02-11 18:38:47', '2014-02-11 18:38:47', 929640376, 814558298)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES ('request_params_include?', 'f', 'pepsi=true', '2014-02-11 18:38:47', '2014-02-11 18:38:47', 435138789, 394627963)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (2, 'banner_leaderboard', 't', '<img src=''pepsi_banner''/>', '2014-02-11 18:38:47', '2014-02-11 18:38:47', 960656439, 394627963)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (1, 'banner_parade', 't', '<img src=''banner_parade''/>', '2014-02-11 18:38:47', '2014-02-11 18:38:47', 281932184, 207249520)
+ [1m[36m (39.3ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+--------------------------------------------
+AdvertSelector::BannerTest: test_HelperItems
+--------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE (advert_selector_helper_items.position IS NOT NULL) AND ("advert_selector_helper_items"."banner_id" = 814558298) ORDER BY advert_selector_helper_items.position DESC LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "position", "updated_at") VALUES (?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["position", 2], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 10)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content_for", true], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "content_for_invalid"], ["position", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "some_limit_helper_here"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656440]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656440]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position > 3)[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------------------
+AdvertSelector::BannerTest: test_find_future_&&_find_current_scopes
+-------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000117' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000869' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.000982' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.001719' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.002377' OR end_time IS NULL) AND (start_time < '2013-02-11 11:00:00.002490' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------
+AdvertSelector::BannerTest: test_name_sym
+-----------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 551], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+--------------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount_reaching_target
+--------------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "target_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["target_view_count", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_for_default_banners
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_time_usages
+------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 11 Feb 2014 11:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 11 Feb 2014 08:00:00 UTC +00:00], ["end_time", Tue, 11 Feb 2014 09:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", nil], ["end_time", Tue, 11 Feb 2014 11:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_basics_compare_value_and_per_fast_mode
+----------------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Sat, 15 Feb 2014 14:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_daily_tests
+-------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Fri, 21 Feb 2014 00:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Tue, 11 Feb 2014 16:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 17:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_per_hour
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Sat, 15 Feb 2014 14:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_create_banner
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#create as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner", "end_time"=>"2014-02-21 00:00:00 UTC", "frequency"=>"0", "name"=>"Pepsi", "placement_id"=>"405688915", "start_time"=>"2014-02-11 00:00:00 UTC", "target_view_count"=>"1000"}}
+Completed 500 Internal Server Error in 1ms
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_destroy_banner
+-----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#destroy as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1 [["id", 435138789]]
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 435138789]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1 [["id", 960656439]]
+ [1m[36mSQL (0.0ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 960656439]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 394627963 AND position > 2)
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ?[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners
+Completed 302 Found in 4ms (ActiveRecord: 0.7ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_edit
+-----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#edit as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ?[0m [["banner_id", 394627963]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (30.3ms)
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.051172') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 56ms (Views: 54.1ms | ActiveRecord: 1.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_index
+------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners"[0m
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.005737') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 9ms (Views: 7.7ms | ActiveRecord: 0.7ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_new
+----------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (14.5ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.017995') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 22ms (Views: 20.6ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_show_banner
+--------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#show as HTML
+ Parameters: {"id"=>"394627963"}
+Redirected to http://test.host/advert_selector/banners/394627963/edit
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#update as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+Completed 500 Internal Server Error in 1ms
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner_running_view_count
+-----------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["running_view_count", 1], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Processing by AdvertSelector::BannersController#update_running_view_count as HTML
+ Parameters: {"banner"=>{"running_view_count"=>"99"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mSQL (0.4ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 1084ms (ActiveRecord: 0.7ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.3ms)[0m rollback transaction
+ [1m[36m (0.2ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_forbidden_with_default_access
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+Filter chain halted as :admin_access_only rendered or redirected
+Completed 403 Forbidden in 2ms (Views: 0.5ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_clear_errors_log
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::MainController#clear_errors_log as HTML
+Redirected to http://test.host/advert_selector/
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_get_index
+---------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.003123') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 7ms (Views: 6.1ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_array=
+-----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085[0m [["conflicting_placements_array", "not_found,video"], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'not_found' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'video' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_string_handling
+--------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_with
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+--------------------------------------------
+AdvertSelector::PlacementTest: test_name_sym
+--------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_create_placement
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+Processing by AdvertSelector::PlacementsController#create as HTML
+ Parameters: {"placement"=>{"name"=>"new placement"}}
+Completed 500 Internal Server Error in 0ms
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_destroy_placement
+-----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_placements"
+Processing by AdvertSelector::PlacementsController#destroy as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[36mAdvertSelector::Placement Load (0.3ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", "405688915"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mDELETE FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ?[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements
+Completed 302 Found in 2ms (ActiveRecord: 0.6ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_edit
+--------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#edit as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (7.1ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.012592') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 16ms (Views: 14.2ms | ActiveRecord: 0.9ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_index
+---------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.005705') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 9ms (Views: 8.1ms | ActiveRecord: 0.7ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_new
+-------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = '') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (3.3ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.006778') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 10ms (Views: 9.0ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_show_placement
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#show as HTML
+ Parameters: {"id"=>"405688915"}
+Redirected to http://test.host/advert_selector/placements/405688915/edit
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_update_placement
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#update as HTML
+ Parameters: {"placement"=>{"name"=>"Leaderboard"}, "id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+Completed 500 Internal Server Error in 1ms
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+------------------------------
+AdvertSelectorTest: test_truth
+------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------
+BannerShowsTest: test_HelperItem_runned
+---------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.010391' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.010560' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 19ms (Views: 17.8ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "always_false"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.032594' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.032743' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------------------
+BannerShowsTest: test_HelperItem_with_raising_error_and_common_error_displays
+-----------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)[0m
+ [1m[35mSQL (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?) [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "raise_error"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007604' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007744' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Error with banner Coke in placement Leaderboard.
+2014-02-11T12:00:00+02:00 - http://www.example.com/ - {"controller"=>"examples", "action"=>"index"}
+#<ZeroDivisionError: divided by 0>
+
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `/'
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `advert_selector_raise_error'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:53:in `block in advert_selector_banner_try'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:49:in `advert_selector_banner_try'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:20:in `block (2 levels) in advert_selector_initialize'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:18:in `block in advert_selector_initialize'
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/advert_selector/placements" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.019020') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mCACHE (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mCACHE (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 7ms (Views: 6.3ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------
+BannerShowsTest: test_banner_frequency,_limit_frequency_within_one_week
+-----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "frequency" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["frequency", 2], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007880' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.008027' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-14 10:00:00.016314' OR end_time IS NULL) AND (start_time < '2014-02-14 11:00:00.016455' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------------------------------
+BannerShowsTest: test_banner_preview_url_forces_banner_and_displays_information
+-------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.006609' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.006772' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+Started GET "/?advert_selector_force=207249520&advert_selector_force_stamp=1392076800" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+ Parameters: {"advert_selector_force"=>"207249520", "advert_selector_force_stamp"=>"1392076800"}
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = 207249520 LIMIT 1
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 718799085]]
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 207249520]]
+[AdvertSelector] ForceShowing banner parade_banner in placement Parade
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.017420' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.017596' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.8ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------------------------------------------
+BannerShowsTest: test_complex_setup_conflicting_banners_placements
+------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520[0m [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008361' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.008530' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 2.2ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+---------------------------------------------------------------
+BannerShowsTest: test_complex_setup_multiple_banners_placements
+---------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520[0m [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085 [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915 [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'video') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 1019730477[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.012896' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.013066' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------
+BannerShowsTest: test_normal_request_and_banner_loading
+-------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.006085' OR end_time IS NULL) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 3.9ms | ActiveRecord: 0.6ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:15:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------
+BannerShowsTest: test_only_once_per_session_banners
+---------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "only_once_per_session" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["only_once_per_session", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008439' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.008579' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.4ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+ExamplesControllerTest: test_render_video_once_per_session
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.001924' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.002073' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.3ms)[0m [1mbegin transaction[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_placements"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Parade', 'leaderboard,video', '2014-02-11 18:38:57', '2014-02-11 18:38:57', 718799085)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Leaderboard', 'parade', '2014-02-11 18:38:57', '2014-02-11 18:38:57', 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "only_once_per_session", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Video', 't', 'parade', '2014-02-11 18:38:57', '2014-02-11 18:38:57', 1019730477)[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_banners"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "running_view_count", "frequency", "fast_mode", "comment", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Coke', '2014-02-06 00:00:00.000000', '2014-02-16 00:00:00.000000', 1000, 100, 0, 'f', 'Coke banner', 't', 50, '2014-02-11 18:38:57', '2014-02-11 18:38:57', 814558298, 405688915)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "comment", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Pepsi', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 0, 'Pepsi banner', 't', 't', 100, '2014-02-11 18:38:57', '2014-02-11 18:38:57', 394627963, 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('parade_banner', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 1, 't', 'f', 1000, '2014-02-11 18:38:57', '2014-02-11 18:38:57', 207249520, 718799085)[0m
+ [1m[35mFixture Delete (0.0ms)[0m DELETE FROM "advert_selector_helper_items"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "position", "created_at", "updated_at", "id", "banner_id") VALUES ('banner_leaderboard', 't', '<img src=''coke_banner''/>', 1, '2014-02-11 18:38:57', '2014-02-11 18:38:57', 929640376, 814558298)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES ('request_params_include?', 'f', 'pepsi=true', '2014-02-11 18:38:57', '2014-02-11 18:38:57', 435138789, 394627963)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (2, 'banner_leaderboard', 't', '<img src=''pepsi_banner''/>', '2014-02-11 18:38:57', '2014-02-11 18:38:57', 960656439, 394627963)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (1, 'banner_parade', 't', '<img src=''banner_parade''/>', '2014-02-11 18:38:57', '2014-02-11 18:38:57', 281932184, 207249520)
+ [1m[36m (51.0ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+--------------------------------------------
+AdvertSelector::BannerTest: test_HelperItems
+--------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE (advert_selector_helper_items.position IS NOT NULL) AND ("advert_selector_helper_items"."banner_id" = 814558298) ORDER BY advert_selector_helper_items.position DESC LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "position", "updated_at") VALUES (?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["position", 2], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 10)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content_for", true], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "content_for_invalid"], ["position", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "some_limit_helper_here"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656440]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656440]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position > 3)[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------------------
+AdvertSelector::BannerTest: test_find_future_&&_find_current_scopes
+-------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000149' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000904' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.001011' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.001870' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.002592' OR end_time IS NULL) AND (start_time < '2013-02-11 11:00:00.002726' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------
+AdvertSelector::BannerTest: test_name_sym
+-----------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 551], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+--------------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount_reaching_target
+--------------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "target_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["target_view_count", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_for_default_banners
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_time_usages
+------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 11 Feb 2014 11:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 11 Feb 2014 08:00:00 UTC +00:00], ["end_time", Tue, 11 Feb 2014 09:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", nil], ["end_time", Tue, 11 Feb 2014 11:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_basics_compare_value_and_per_fast_mode
+----------------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Sat, 15 Feb 2014 14:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_daily_tests
+-------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Fri, 21 Feb 2014 00:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Tue, 11 Feb 2014 16:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 17:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_per_hour
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Sat, 15 Feb 2014 14:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_create_banner
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#create as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner", "end_time"=>"2014-02-21 00:00:00 UTC", "frequency"=>"0", "name"=>"Pepsi", "placement_id"=>"405688915", "start_time"=>"2014-02-11 00:00:00 UTC", "target_view_count"=>"1000"}}
+Completed 500 Internal Server Error in 1ms
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_destroy_banner
+-----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#destroy as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1 [["id", 435138789]]
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 435138789]]
+ [1m[35mAdvertSelector::HelperItem Load (0.0ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1 [["id", 960656439]]
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 960656439]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 394627963 AND position > 2)
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ?[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners
+Completed 302 Found in 4ms (ActiveRecord: 0.7ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_edit
+-----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#edit as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ?[0m [["banner_id", 394627963]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (31.2ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.043355') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 48ms (Views: 46.3ms | ActiveRecord: 1.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_index
+------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners"[0m
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.005203') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 9ms (Views: 8.0ms | ActiveRecord: 0.7ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_new
+----------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (14.4ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.017529') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 21ms (Views: 19.7ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_show_banner
+--------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#show as HTML
+ Parameters: {"id"=>"394627963"}
+Redirected to http://test.host/advert_selector/banners/394627963/edit
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#update as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+Completed 500 Internal Server Error in 1ms
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner_running_view_count
+-----------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["running_view_count", 1], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Processing by AdvertSelector::BannersController#update_running_view_count as HTML
+ Parameters: {"banner"=>{"running_view_count"=>"99"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mSQL (0.4ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 1089ms (ActiveRecord: 0.6ms)
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_forbidden_with_default_access
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+Filter chain halted as :admin_access_only rendered or redirected
+Completed 403 Forbidden in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_clear_errors_log
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::MainController#clear_errors_log as HTML
+Redirected to http://test.host/advert_selector/
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_get_index
+---------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.003820') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_array=
+-----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085[0m [["conflicting_placements_array", "not_found,video"], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'not_found' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'video' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_string_handling
+--------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_with
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------
+AdvertSelector::PlacementTest: test_name_sym
+--------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_create_placement
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+Processing by AdvertSelector::PlacementsController#create as HTML
+ Parameters: {"placement"=>{"name"=>"new placement"}}
+Completed 500 Internal Server Error in 0ms
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_destroy_placement
+-----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_placements"
+Processing by AdvertSelector::PlacementsController#destroy as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", "405688915"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ?[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements
+Completed 302 Found in 2ms (ActiveRecord: 0.3ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_edit
+--------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#edit as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (6.4ms)
+ [1m[36mAdvertSelector::Banner Load (0.4ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.011361') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 15ms (Views: 13.3ms | ActiveRecord: 1.1ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_index
+---------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.006063') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 9ms (Views: 8.0ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_new
+-------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = '') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (3.9ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.007555') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 11ms (Views: 9.6ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_show_placement
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#show as HTML
+ Parameters: {"id"=>"405688915"}
+Redirected to http://test.host/advert_selector/placements/405688915/edit
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_update_placement
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#update as HTML
+ Parameters: {"placement"=>{"name"=>"Leaderboard"}, "id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+Completed 500 Internal Server Error in 1ms
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------
+AdvertSelectorTest: test_truth
+------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------
+BannerShowsTest: test_HelperItem_runned
+---------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.011770' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.011975' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 14ms (Views: 13.2ms | ActiveRecord: 0.6ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "always_false"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.028734' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.028859' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------------------
+BannerShowsTest: test_HelperItem_with_raising_error_and_common_error_displays
+-----------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)[0m
+ [1m[35mSQL (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?) [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "raise_error"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.009995' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.010121' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Error with banner Coke in placement Leaderboard.
+2014-02-11T12:00:00+02:00 - http://www.example.com/ - {"controller"=>"examples", "action"=>"index"}
+#<ZeroDivisionError: divided by 0>
+
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `/'
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `advert_selector_raise_error'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:53:in `block in advert_selector_banner_try'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:49:in `advert_selector_banner_try'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:20:in `block (2 levels) in advert_selector_initialize'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:18:in `block in advert_selector_initialize'
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 3.9ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/advert_selector/placements" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.020773') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mCACHE (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mCACHE (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 7ms (Views: 6.1ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------
+BannerShowsTest: test_banner_frequency,_limit_frequency_within_one_week
+-----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "frequency" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["frequency", 2], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007334' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007456' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 9ms (Views: 8.3ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-14 10:00:00.019141' OR end_time IS NULL) AND (start_time < '2014-02-14 11:00:00.019312' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------------------------------
+BannerShowsTest: test_banner_preview_url_forces_banner_and_displays_information
+-------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007191' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007339' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+Started GET "/?advert_selector_force=207249520&advert_selector_force_stamp=1392076800" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+ Parameters: {"advert_selector_force"=>"207249520", "advert_selector_force_stamp"=>"1392076800"}
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = 207249520 LIMIT 1
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 718799085]]
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 207249520]]
+[AdvertSelector] ForceShowing banner parade_banner in placement Parade
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.017135' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.017302' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 4.9ms | ActiveRecord: 0.7ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------------------------------------------
+BannerShowsTest: test_complex_setup_conflicting_banners_placements
+------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520[0m [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008886' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.009140' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 2.1ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+---------------------------------------------------------------
+BannerShowsTest: test_complex_setup_multiple_banners_placements
+---------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520[0m [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085 [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915 [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'video') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 1019730477[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.013518' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.013652' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------
+BannerShowsTest: test_normal_request_and_banner_loading
+-------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.006065' OR end_time IS NULL) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:15:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 2.3ms | ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------
+BannerShowsTest: test_only_once_per_session_banners
+---------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_placements" SET "only_once_per_session" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["only_once_per_session", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008672' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.008935' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+ExamplesControllerTest: test_render_video_once_per_session
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.001904' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.002085' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.4ms)[0m [1mbegin transaction[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_placements"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Parade', 'leaderboard,video', '2014-02-11 18:40:15', '2014-02-11 18:40:15', 718799085)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Leaderboard', 'parade', '2014-02-11 18:40:15', '2014-02-11 18:40:15', 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "only_once_per_session", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Video', 't', 'parade', '2014-02-11 18:40:15', '2014-02-11 18:40:15', 1019730477)[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_banners"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "running_view_count", "frequency", "fast_mode", "comment", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Coke', '2014-02-06 00:00:00.000000', '2014-02-16 00:00:00.000000', 1000, 100, 0, 'f', 'Coke banner', 't', 50, '2014-02-11 18:40:15', '2014-02-11 18:40:15', 814558298, 405688915)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "comment", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Pepsi', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 0, 'Pepsi banner', 't', 't', 100, '2014-02-11 18:40:15', '2014-02-11 18:40:15', 394627963, 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('parade_banner', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 1, 't', 'f', 1000, '2014-02-11 18:40:15', '2014-02-11 18:40:15', 207249520, 718799085)[0m
+ [1m[35mFixture Delete (0.0ms)[0m DELETE FROM "advert_selector_helper_items"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "position", "created_at", "updated_at", "id", "banner_id") VALUES ('banner_leaderboard', 't', '<img src=''coke_banner''/>', 1, '2014-02-11 18:40:15', '2014-02-11 18:40:15', 929640376, 814558298)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES ('request_params_include?', 'f', 'pepsi=true', '2014-02-11 18:40:15', '2014-02-11 18:40:15', 435138789, 394627963)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (2, 'banner_leaderboard', 't', '<img src=''pepsi_banner''/>', '2014-02-11 18:40:15', '2014-02-11 18:40:15', 960656439, 394627963)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (1, 'banner_parade', 't', '<img src=''banner_parade''/>', '2014-02-11 18:40:15', '2014-02-11 18:40:15', 281932184, 207249520)
+ [1m[36m (58.0ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+--------------------------------------------
+AdvertSelector::BannerTest: test_HelperItems
+--------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE (advert_selector_helper_items.position IS NOT NULL) AND ("advert_selector_helper_items"."banner_id" = 814558298) ORDER BY advert_selector_helper_items.position DESC LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "position", "updated_at") VALUES (?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["position", 2], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 10)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content_for", true], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "content_for_invalid"], ["position", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "some_limit_helper_here"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656440]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656440]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position > 3)[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------------------
+AdvertSelector::BannerTest: test_find_future_&&_find_current_scopes
+-------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000106' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000924' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.001055' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.001876' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.002545' OR end_time IS NULL) AND (start_time < '2013-02-11 11:00:00.002654' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------
+AdvertSelector::BannerTest: test_name_sym
+-----------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 551], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+--------------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount_reaching_target
+--------------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "target_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["target_view_count", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_for_default_banners
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_time_usages
+------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 11 Feb 2014 11:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 11 Feb 2014 08:00:00 UTC +00:00], ["end_time", Tue, 11 Feb 2014 09:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", nil], ["end_time", Tue, 11 Feb 2014 11:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_basics_compare_value_and_per_fast_mode
+----------------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Sat, 15 Feb 2014 14:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_daily_tests
+-------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Fri, 21 Feb 2014 00:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Tue, 11 Feb 2014 16:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 17:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_per_hour
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Sat, 15 Feb 2014 14:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_create_banner
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#create as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner", "end_time"=>"2014-02-21 00:00:00 UTC", "frequency"=>"0", "name"=>"Pepsi", "placement_id"=>"405688915", "start_time"=>"2014-02-11 00:00:00 UTC", "target_view_count"=>"1000"}}
+Completed 500 Internal Server Error in 1ms
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_destroy_banner
+-----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#destroy as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1 [["id", 435138789]]
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 435138789]]
+ [1m[35mAdvertSelector::HelperItem Load (0.0ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1 [["id", 960656439]]
+ [1m[36mSQL (0.0ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 960656439]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 394627963 AND position > 2)
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ?[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners
+Completed 302 Found in 4ms (ActiveRecord: 0.7ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_edit
+-----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#edit as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ?[0m [["banner_id", 394627963]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (29.7ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.042171') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 46ms (Views: 44.8ms | ActiveRecord: 1.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_index
+------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners"[0m
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.005213') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 9ms (Views: 7.6ms | ActiveRecord: 0.7ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_new
+----------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (14.1ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.017367') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 20ms (Views: 19.3ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_show_banner
+--------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#show as HTML
+ Parameters: {"id"=>"394627963"}
+Redirected to http://test.host/advert_selector/banners/394627963/edit
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#update as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+Completed 500 Internal Server Error in 1ms
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner_running_view_count
+-----------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["running_view_count", 1], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Processing by AdvertSelector::BannersController#update_running_view_count as HTML
+ Parameters: {"banner"=>{"running_view_count"=>"99"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mSQL (0.6ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 1084ms (ActiveRecord: 0.8ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.3ms)[0m rollback transaction
+ [1m[36m (0.2ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_forbidden_with_default_access
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+Filter chain halted as :admin_access_only rendered or redirected
+Completed 403 Forbidden in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_clear_errors_log
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::MainController#clear_errors_log as HTML
+Redirected to http://test.host/advert_selector/
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_get_index
+---------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.003637') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_array=
+-----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085[0m [["conflicting_placements_array", "not_found,video"], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'not_found' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'video' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_string_handling
+--------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_with
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------
+AdvertSelector::PlacementTest: test_name_sym
+--------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_create_placement
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+Processing by AdvertSelector::PlacementsController#create as HTML
+ Parameters: {"placement"=>{"name"=>"new placement"}}
+Completed 500 Internal Server Error in 0ms
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_destroy_placement
+-----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_placements"
+Processing by AdvertSelector::PlacementsController#destroy as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", "405688915"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mDELETE FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ?[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements
+Completed 302 Found in 2ms (ActiveRecord: 0.5ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_edit
+--------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#edit as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (6.1ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.011220') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 15ms (Views: 13.1ms | ActiveRecord: 0.9ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_index
+---------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.005634') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 9ms (Views: 7.9ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_new
+-------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = '') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (3.5ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.007001') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 10ms (Views: 8.8ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_show_placement
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#show as HTML
+ Parameters: {"id"=>"405688915"}
+Redirected to http://test.host/advert_selector/placements/405688915/edit
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_update_placement
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+------------------------------
+AdvertSelectorTest: test_truth
+------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+---------------------------------------
+BannerShowsTest: test_HelperItem_runned
+---------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.3ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.012023' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.012205' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 15ms (Views: 14.0ms | ActiveRecord: 0.6ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)[0m
+ [1m[35mSQL (0.2ms)[0m INSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?) [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "always_false"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.030638' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.030783' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------------
+BannerShowsTest: test_HelperItem_with_raising_error_and_common_error_displays
+-----------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "raise_error"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008749' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.008879' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Error with banner Coke in placement Leaderboard.
+2014-02-11T12:00:00+02:00 - http://www.example.com/ - {"controller"=>"examples", "action"=>"index"}
+#<ZeroDivisionError: divided by 0>
+
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `/'
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `advert_selector_raise_error'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:53:in `block in advert_selector_banner_try'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:49:in `advert_selector_banner_try'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:20:in `block (2 levels) in advert_selector_initialize'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:18:in `block in advert_selector_initialize'
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/advert_selector/placements" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+ [1m[35mAdvertSelector::Banner Load (0.3ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.019619') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mCACHE (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mCACHE (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 8ms (Views: 7.2ms | ActiveRecord: 0.6ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------------
+BannerShowsTest: test_banner_frequency,_limit_frequency_within_one_week
+-----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "frequency" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["frequency", 2], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007728' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007850' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-14 10:00:00.020048' OR end_time IS NULL) AND (start_time < '2014-02-14 11:00:00.020208' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.6ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------------------------------
+BannerShowsTest: test_banner_preview_url_forces_banner_and_displays_information
+-------------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007677' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007805' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 207249520]]
+Started GET "/?advert_selector_force=207249520&advert_selector_force_stamp=1392076800" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+ Parameters: {"advert_selector_force"=>"207249520", "advert_selector_force_stamp"=>"1392076800"}
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = 207249520 LIMIT 1[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 207249520]]
+[AdvertSelector] ForceShowing banner parade_banner in placement Parade
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.018172' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.018401' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 7ms (Views: 6.1ms | ActiveRecord: 0.8ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+------------------------------------------------------------------
+BannerShowsTest: test_complex_setup_conflicting_banners_placements
+------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520 [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 207249520]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008547' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.008691' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 207249520]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 2.1ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 207249520]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------------
+BannerShowsTest: test_complex_setup_multiple_banners_placements
+---------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520 [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 207249520]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 718799085]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'video') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 1019730477 [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.014559' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.014698' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 207249520]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------
+BannerShowsTest: test_normal_request_and_banner_loading
+-------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.006202' OR end_time IS NULL) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:15:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+---------------------------------------------------
+BannerShowsTest: test_only_once_per_session_banners
+---------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_placements" SET "only_once_per_session" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915 [["only_once_per_session", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.009033' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.009220' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.0ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+----------------------------------------------------------
+ExamplesControllerTest: test_render_video_once_per_session
+----------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.002035' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.002184' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 4.9ms | ActiveRecord: 0.5ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[36m (0.3ms)[0m [1mbegin transaction[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_placements"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Parade', 'leaderboard,video', '2014-02-11 18:40:28', '2014-02-11 18:40:28', 718799085)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Leaderboard', 'parade', '2014-02-11 18:40:28', '2014-02-11 18:40:28', 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "only_once_per_session", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Video', 't', 'parade', '2014-02-11 18:40:28', '2014-02-11 18:40:28', 1019730477)[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_banners"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "running_view_count", "frequency", "fast_mode", "comment", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Coke', '2014-02-06 00:00:00.000000', '2014-02-16 00:00:00.000000', 1000, 100, 0, 'f', 'Coke banner', 't', 50, '2014-02-11 18:40:28', '2014-02-11 18:40:28', 814558298, 405688915)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "comment", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Pepsi', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 0, 'Pepsi banner', 't', 't', 100, '2014-02-11 18:40:28', '2014-02-11 18:40:28', 394627963, 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('parade_banner', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 1, 't', 'f', 1000, '2014-02-11 18:40:28', '2014-02-11 18:40:28', 207249520, 718799085)[0m
+ [1m[35mFixture Delete (0.0ms)[0m DELETE FROM "advert_selector_helper_items"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "position", "created_at", "updated_at", "id", "banner_id") VALUES ('banner_leaderboard', 't', '<img src=''coke_banner''/>', 1, '2014-02-11 18:40:28', '2014-02-11 18:40:28', 929640376, 814558298)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES ('request_params_include?', 'f', 'pepsi=true', '2014-02-11 18:40:28', '2014-02-11 18:40:28', 435138789, 394627963)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (2, 'banner_leaderboard', 't', '<img src=''pepsi_banner''/>', '2014-02-11 18:40:28', '2014-02-11 18:40:28', 960656439, 394627963)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (1, 'banner_parade', 't', '<img src=''banner_parade''/>', '2014-02-11 18:40:28', '2014-02-11 18:40:28', 281932184, 207249520)
+ [1m[36m (42.5ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+--------------------------------------------
+AdvertSelector::BannerTest: test_HelperItems
+--------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE (advert_selector_helper_items.position IS NOT NULL) AND ("advert_selector_helper_items"."banner_id" = 814558298) ORDER BY advert_selector_helper_items.position DESC LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "position", "updated_at") VALUES (?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["position", 2], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 10)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content_for", true], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "content_for_invalid"], ["position", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "some_limit_helper_here"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656440]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656440]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position > 3)[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------------------
+AdvertSelector::BannerTest: test_find_future_&&_find_current_scopes
+-------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000096' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000839' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.000955' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.001753' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.002427' OR end_time IS NULL) AND (start_time < '2013-02-11 11:00:00.002533' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------
+AdvertSelector::BannerTest: test_name_sym
+-----------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (4.0ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 551], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+--------------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount_reaching_target
+--------------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "target_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["target_view_count", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_for_default_banners
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_time_usages
+------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 11 Feb 2014 11:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 11 Feb 2014 08:00:00 UTC +00:00], ["end_time", Tue, 11 Feb 2014 09:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", nil], ["end_time", Tue, 11 Feb 2014 11:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_basics_compare_value_and_per_fast_mode
+----------------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Sat, 15 Feb 2014 14:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_daily_tests
+-------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Fri, 21 Feb 2014 00:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Tue, 11 Feb 2014 16:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 17:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_per_hour
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Sat, 15 Feb 2014 14:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_create_banner
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#create as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner", "end_time"=>"2014-02-21 00:00:00 UTC", "frequency"=>"0", "name"=>"Pepsi", "placement_id"=>"405688915", "start_time"=>"2014-02-11 00:00:00 UTC", "target_view_count"=>"1000"}}
+Completed 500 Internal Server Error in 1ms
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_destroy_banner
+-----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#destroy as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1 [["id", 435138789]]
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 435138789]]
+ [1m[35mAdvertSelector::HelperItem Load (0.0ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1 [["id", 960656439]]
+ [1m[36mSQL (0.0ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 960656439]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 394627963 AND position > 2)
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ?[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners
+Completed 302 Found in 4ms (ActiveRecord: 0.6ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_edit
+-----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#edit as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ?[0m [["banner_id", 394627963]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (30.0ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.042572') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 47ms (Views: 45.4ms | ActiveRecord: 0.9ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_index
+------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners"[0m
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.005022') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 8ms (Views: 7.1ms | ActiveRecord: 0.6ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_new
+----------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (14.0ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.017454') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 20ms (Views: 19.3ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_show_banner
+--------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#show as HTML
+ Parameters: {"id"=>"394627963"}
+Redirected to http://test.host/advert_selector/banners/394627963/edit
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#update as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+Completed 500 Internal Server Error in 1ms
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+-----------------------------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner_running_view_count
+-----------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["running_view_count", 1], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Processing by AdvertSelector::BannersController#update_running_view_count as HTML
+ Parameters: {"banner"=>{"running_view_count"=>"99"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mSQL (0.4ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 1088ms (ActiveRecord: 0.6ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.3ms)[0m rollback transaction
+ [1m[36m (0.2ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_forbidden_with_default_access
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.3ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+Filter chain halted as :admin_access_only rendered or redirected
+Completed 403 Forbidden in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_clear_errors_log
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::MainController#clear_errors_log as HTML
+Redirected to http://test.host/advert_selector/
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_get_index
+---------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.003785') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 8ms (Views: 6.6ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.7ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.3ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_array=
+-----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085[0m [["conflicting_placements_array", "not_found,video"], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'not_found' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'video' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_string_handling
+--------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_with
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------
+AdvertSelector::PlacementTest: test_name_sym
+--------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_create_placement
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+Processing by AdvertSelector::PlacementsController#create as HTML
+ Parameters: {"placement"=>{"name"=>"new placement"}}
+Completed 500 Internal Server Error in 0ms
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_destroy_placement
+-----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_placements"
+Processing by AdvertSelector::PlacementsController#destroy as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", "405688915"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mDELETE FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ?[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements
+Completed 302 Found in 2ms (ActiveRecord: 0.4ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_edit
+--------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#edit as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (6.7ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.011977') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 15ms (Views: 13.6ms | ActiveRecord: 1.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_index
+---------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.005604') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 9ms (Views: 7.8ms | ActiveRecord: 0.7ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_new
+-------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = '') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (3.6ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.007043') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 10ms (Views: 9.0ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_show_placement
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#show as HTML
+ Parameters: {"id"=>"405688915"}
+Redirected to http://test.host/advert_selector/placements/405688915/edit
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_update_placement
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#update as HTML
+ Parameters: {"placement"=>{"name"=>"Leaderboard"}, "id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+Completed 500 Internal Server Error in 1ms
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+------------------------------
+AdvertSelectorTest: test_truth
+------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------
+BannerShowsTest: test_HelperItem_runned
+---------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.010889' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.011071' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 13ms (Views: 11.8ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "always_false"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.027148' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.027298' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------------------
+BannerShowsTest: test_HelperItem_with_raising_error_and_common_error_displays
+-----------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)[0m
+ [1m[35mSQL (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?) [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "raise_error"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007717' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007857' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Error with banner Coke in placement Leaderboard.
+2014-02-11T12:00:00+02:00 - http://www.example.com/ - {"controller"=>"examples", "action"=>"index"}
+#<ZeroDivisionError: divided by 0>
+
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `/'
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `advert_selector_raise_error'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:53:in `block in advert_selector_banner_try'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:49:in `advert_selector_banner_try'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:20:in `block (2 levels) in advert_selector_initialize'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:18:in `block in advert_selector_initialize'
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/advert_selector/placements" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.018422') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mCACHE (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mCACHE (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 7ms (Views: 6.8ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------
+BannerShowsTest: test_banner_frequency,_limit_frequency_within_one_week
+-----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "frequency" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["frequency", 2], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007265' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007384' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 9ms (Views: 8.2ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.3ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-14 10:00:00.018942' OR end_time IS NULL) AND (start_time < '2014-02-14 11:00:00.019091' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.3ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 7ms (Views: 6.0ms | ActiveRecord: 0.6ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+-------------------------------------------------------------------------------
+BannerShowsTest: test_banner_preview_url_forces_banner_and_displays_information
+-------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.006964' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007118' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+Started GET "/?advert_selector_force=207249520&advert_selector_force_stamp=1392076800" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+ Parameters: {"advert_selector_force"=>"207249520", "advert_selector_force_stamp"=>"1392076800"}
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = 207249520 LIMIT 1
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 718799085]]
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 207249520]]
+[AdvertSelector] ForceShowing banner parade_banner in placement Parade
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.016900' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.017049' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 7ms (Views: 6.0ms | ActiveRecord: 0.8ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------------------------------------------
+BannerShowsTest: test_complex_setup_conflicting_banners_placements
+------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520[0m [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008281' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.008410' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+---------------------------------------------------------------
+BannerShowsTest: test_complex_setup_multiple_banners_placements
+---------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520[0m [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085 [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915 [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'video') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 1019730477[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.014674' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.014840' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.0ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+-------------------------------------------------------
+BannerShowsTest: test_normal_request_and_banner_loading
+-------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.3ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.006008' OR end_time IS NULL) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.6ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:15:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------
+BannerShowsTest: test_only_once_per_session_banners
+---------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "only_once_per_session" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["only_once_per_session", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008617' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.008863' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+ExamplesControllerTest: test_render_video_once_per_session
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.001827' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.002006' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.5ms)[0m [1mbegin transaction[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_placements"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Parade', 'leaderboard,video', '2014-02-11 18:40:42', '2014-02-11 18:40:42', 718799085)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Leaderboard', 'parade', '2014-02-11 18:40:42', '2014-02-11 18:40:42', 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "only_once_per_session", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Video', 't', 'parade', '2014-02-11 18:40:42', '2014-02-11 18:40:42', 1019730477)[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_banners"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "running_view_count", "frequency", "fast_mode", "comment", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Coke', '2014-02-06 00:00:00.000000', '2014-02-16 00:00:00.000000', 1000, 100, 0, 'f', 'Coke banner', 't', 50, '2014-02-11 18:40:42', '2014-02-11 18:40:42', 814558298, 405688915)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "comment", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Pepsi', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 0, 'Pepsi banner', 't', 't', 100, '2014-02-11 18:40:42', '2014-02-11 18:40:42', 394627963, 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('parade_banner', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 1, 't', 'f', 1000, '2014-02-11 18:40:42', '2014-02-11 18:40:42', 207249520, 718799085)[0m
+ [1m[35mFixture Delete (0.0ms)[0m DELETE FROM "advert_selector_helper_items"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "position", "created_at", "updated_at", "id", "banner_id") VALUES ('banner_leaderboard', 't', '<img src=''coke_banner''/>', 1, '2014-02-11 18:40:42', '2014-02-11 18:40:42', 929640376, 814558298)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES ('request_params_include?', 'f', 'pepsi=true', '2014-02-11 18:40:42', '2014-02-11 18:40:42', 435138789, 394627963)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (2, 'banner_leaderboard', 't', '<img src=''pepsi_banner''/>', '2014-02-11 18:40:42', '2014-02-11 18:40:42', 960656439, 394627963)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (1, 'banner_parade', 't', '<img src=''banner_parade''/>', '2014-02-11 18:40:42', '2014-02-11 18:40:42', 281932184, 207249520)
+ [1m[36m (31.9ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+--------------------------------------------
+AdvertSelector::BannerTest: test_HelperItems
+--------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE (advert_selector_helper_items.position IS NOT NULL) AND ("advert_selector_helper_items"."banner_id" = 814558298) ORDER BY advert_selector_helper_items.position DESC LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "position", "updated_at") VALUES (?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["position", 2], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 10)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content_for", true], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "content_for_invalid"], ["position", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "some_limit_helper_here"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656440]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656440]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position > 3)[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------------------
+AdvertSelector::BannerTest: test_find_future_&&_find_current_scopes
+-------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000100' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000847' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.000958' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.001692' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.002306' OR end_time IS NULL) AND (start_time < '2013-02-11 11:00:00.002420' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------
+AdvertSelector::BannerTest: test_name_sym
+-----------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 551], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+--------------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount_reaching_target
+--------------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "target_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["target_view_count", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_for_default_banners
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_time_usages
+------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 11 Feb 2014 11:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 11 Feb 2014 08:00:00 UTC +00:00], ["end_time", Tue, 11 Feb 2014 09:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", nil], ["end_time", Tue, 11 Feb 2014 11:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_basics_compare_value_and_per_fast_mode
+----------------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Sat, 15 Feb 2014 14:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_daily_tests
+-------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Fri, 21 Feb 2014 00:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Tue, 11 Feb 2014 16:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 17:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_per_hour
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Sat, 15 Feb 2014 14:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_create_banner
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#create as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner", "end_time"=>"2014-02-21 00:00:00 UTC", "frequency"=>"0", "name"=>"Pepsi", "placement_id"=>"405688915", "start_time"=>"2014-02-11 00:00:00 UTC", "target_view_count"=>"1000"}}
+Completed 500 Internal Server Error in 1ms
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_destroy_banner
+-----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#destroy as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1 [["id", 435138789]]
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 435138789]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1 [["id", 960656439]]
+ [1m[36mSQL (0.0ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 960656439]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 394627963 AND position > 2)
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ?[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners
+Completed 302 Found in 4ms (ActiveRecord: 0.7ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_edit
+-----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#edit as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ?[0m [["banner_id", 394627963]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (31.0ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.043113') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 47ms (Views: 45.8ms | ActiveRecord: 0.9ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_index
+------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners"[0m
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.004994') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 8ms (Views: 7.6ms | ActiveRecord: 0.6ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_new
+----------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (13.9ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.017053') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 20ms (Views: 19.2ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_show_banner
+--------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#show as HTML
+ Parameters: {"id"=>"394627963"}
+Redirected to http://test.host/advert_selector/banners/394627963/edit
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#update as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+Completed 500 Internal Server Error in 1ms
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner_running_view_count
+-----------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["running_view_count", 1], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Processing by AdvertSelector::BannersController#update_running_view_count as HTML
+ Parameters: {"banner"=>{"running_view_count"=>"99"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mSQL (0.6ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 1082ms (ActiveRecord: 0.8ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.3ms)[0m rollback transaction
+ [1m[36m (0.2ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_forbidden_with_default_access
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+Filter chain halted as :admin_access_only rendered or redirected
+Completed 403 Forbidden in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_clear_errors_log
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::MainController#clear_errors_log as HTML
+Redirected to http://test.host/advert_selector/
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_get_index
+---------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.003795') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 8ms (Views: 7.2ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_array=
+-----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085[0m [["conflicting_placements_array", "not_found,video"], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'not_found' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'video' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_string_handling
+--------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_with
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+--------------------------------------------
+AdvertSelector::PlacementTest: test_name_sym
+--------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_create_placement
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+Processing by AdvertSelector::PlacementsController#create as HTML
+ Parameters: {"placement"=>{"name"=>"new placement"}}
+Completed 500 Internal Server Error in 0ms
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_destroy_placement
+-----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_placements"
+Processing by AdvertSelector::PlacementsController#destroy as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", "405688915"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ?[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements
+Completed 302 Found in 2ms (ActiveRecord: 0.3ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_edit
+--------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#edit as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (6.6ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.012118') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 15ms (Views: 13.5ms | ActiveRecord: 0.8ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_index
+---------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.005788') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 9ms (Views: 8.0ms | ActiveRecord: 0.8ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_new
+-------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = '') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (3.6ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.006897') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 10ms (Views: 9.1ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_show_placement
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#show as HTML
+ Parameters: {"id"=>"405688915"}
+Redirected to http://test.host/advert_selector/placements/405688915/edit
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_update_placement_asdf
+---------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+------------------------------
+AdvertSelectorTest: test_truth
+------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+---------------------------------------
+BannerShowsTest: test_HelperItem_runned
+---------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.011133' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.011311' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 13ms (Views: 12.0ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)[0m
+ [1m[35mSQL (0.2ms)[0m INSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?) [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "always_false"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.027297' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.027431' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------------
+BannerShowsTest: test_HelperItem_with_raising_error_and_common_error_displays
+-----------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "raise_error"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008739' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.008861' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Error with banner Coke in placement Leaderboard.
+2014-02-11T12:00:00+02:00 - http://www.example.com/ - {"controller"=>"examples", "action"=>"index"}
+#<ZeroDivisionError: divided by 0>
+
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `/'
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `advert_selector_raise_error'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:53:in `block in advert_selector_banner_try'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:49:in `advert_selector_banner_try'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:20:in `block (2 levels) in advert_selector_initialize'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:18:in `block in advert_selector_initialize'
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/advert_selector/placements" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.020087') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mCACHE (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mCACHE (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 8ms (Views: 7.2ms | ActiveRecord: 0.5ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------------
+BannerShowsTest: test_banner_frequency,_limit_frequency_within_one_week
+-----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "frequency" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["frequency", 2], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007559' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007713' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-14 10:00:00.019896' OR end_time IS NULL) AND (start_time < '2014-02-14 11:00:00.020117' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.5ms | ActiveRecord: 0.6ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.5ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------------------------------
+BannerShowsTest: test_banner_preview_url_forces_banner_and_displays_information
+-------------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007793' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007919' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 3.9ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 207249520]]
+Started GET "/?advert_selector_force=207249520&advert_selector_force_stamp=1392076800" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+ Parameters: {"advert_selector_force"=>"207249520", "advert_selector_force_stamp"=>"1392076800"}
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = 207249520 LIMIT 1[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 207249520]]
+[AdvertSelector] ForceShowing banner parade_banner in placement Parade
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.018780' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.018916' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 7ms (Views: 5.7ms | ActiveRecord: 0.8ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+------------------------------------------------------------------
+BannerShowsTest: test_complex_setup_conflicting_banners_placements
+------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520 [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 207249520]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008973' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.009113' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.4ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 207249520]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 207249520]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------------
+BannerShowsTest: test_complex_setup_multiple_banners_placements
+---------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520 [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 207249520]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 718799085]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'video') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 1019730477 [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.014367' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.014530' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 207249520]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------
+BannerShowsTest: test_normal_request_and_banner_loading
+-------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007138' OR end_time IS NULL) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 3.9ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:15:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+---------------------------------------------------
+BannerShowsTest: test_only_once_per_session_banners
+---------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_placements" SET "only_once_per_session" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915 [["only_once_per_session", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.009599' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.009778' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.4ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+----------------------------------------------------------
+ExamplesControllerTest: test_render_video_once_per_session
+----------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.001956' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.002106' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 4.9ms | ActiveRecord: 0.5ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[36m (0.3ms)[0m [1mbegin transaction[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_placements"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Parade', 'leaderboard,video', '2014-02-11 18:40:59', '2014-02-11 18:40:59', 718799085)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Leaderboard', 'parade', '2014-02-11 18:40:59', '2014-02-11 18:40:59', 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "only_once_per_session", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Video', 't', 'parade', '2014-02-11 18:40:59', '2014-02-11 18:40:59', 1019730477)[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_banners"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "running_view_count", "frequency", "fast_mode", "comment", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Coke', '2014-02-06 00:00:00.000000', '2014-02-16 00:00:00.000000', 1000, 100, 0, 'f', 'Coke banner', 't', 50, '2014-02-11 18:40:59', '2014-02-11 18:40:59', 814558298, 405688915)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "comment", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Pepsi', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 0, 'Pepsi banner', 't', 't', 100, '2014-02-11 18:40:59', '2014-02-11 18:40:59', 394627963, 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('parade_banner', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 1, 't', 'f', 1000, '2014-02-11 18:40:59', '2014-02-11 18:40:59', 207249520, 718799085)[0m
+ [1m[35mFixture Delete (0.0ms)[0m DELETE FROM "advert_selector_helper_items"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "position", "created_at", "updated_at", "id", "banner_id") VALUES ('banner_leaderboard', 't', '<img src=''coke_banner''/>', 1, '2014-02-11 18:40:59', '2014-02-11 18:40:59', 929640376, 814558298)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES ('request_params_include?', 'f', 'pepsi=true', '2014-02-11 18:40:59', '2014-02-11 18:40:59', 435138789, 394627963)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (2, 'banner_leaderboard', 't', '<img src=''pepsi_banner''/>', '2014-02-11 18:40:59', '2014-02-11 18:40:59', 960656439, 394627963)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (1, 'banner_parade', 't', '<img src=''banner_parade''/>', '2014-02-11 18:40:59', '2014-02-11 18:40:59', 281932184, 207249520)
+ [1m[36m (45.2ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+--------------------------------------------
+AdvertSelector::BannerTest: test_HelperItems
+--------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE (advert_selector_helper_items.position IS NOT NULL) AND ("advert_selector_helper_items"."banner_id" = 814558298) ORDER BY advert_selector_helper_items.position DESC LIMIT 1
+ [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "position", "updated_at") VALUES (?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["position", 2], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 10)
+ [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content_for", true], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "content_for_invalid"], ["position", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.3ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "some_limit_helper_here"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656440]]
+ [1m[35mSQL (0.2ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656440]]
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position > 3)[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+-------------------------------------------------------------------
+AdvertSelector::BannerTest: test_find_future_&&_find_current_scopes
+-------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000117' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.001004' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.001138' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.2ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.002073' OR end_time IS NULL)
+ [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.002981' OR end_time IS NULL) AND (start_time < '2013-02-11 11:00:00.003163' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------
+AdvertSelector::BannerTest: test_name_sym
+-----------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (5.3ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 551], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+--------------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount_reaching_target
+--------------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "target_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["target_view_count", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_for_default_banners
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.2ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_time_usages
+------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 11 Feb 2014 11:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 11 Feb 2014 08:00:00 UTC +00:00], ["end_time", Tue, 11 Feb 2014 09:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", nil], ["end_time", Tue, 11 Feb 2014 11:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_basics_compare_value_and_per_fast_mode
+----------------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Sat, 15 Feb 2014 14:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_daily_tests
+-------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Fri, 21 Feb 2014 00:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Tue, 11 Feb 2014 16:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 17:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_per_hour
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.4ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Mon, 10 Feb 2014 22:00:00 UTC +00:00], ["end_time", Sat, 15 Feb 2014 14:00:00 UTC +00:00], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_create_banner
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#create as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner", "end_time"=>"2014-02-21 00:00:00 UTC", "frequency"=>"0", "name"=>"Pepsi", "placement_id"=>"405688915", "start_time"=>"2014-02-11 00:00:00 UTC", "target_view_count"=>"1000"}}
+Completed 500 Internal Server Error in 1ms
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_destroy_banner
+-----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#destroy as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1 [["id", 435138789]]
+ [1m[36mSQL (0.2ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 435138789]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1 [["id", 960656439]]
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 960656439]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 394627963 AND position > 2)
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ?[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners
+Completed 302 Found in 6ms (ActiveRecord: 1.0ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_edit
+-----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#edit as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35mAdvertSelector::Placement Load (0.3ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ?[0m [["banner_id", 394627963]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (37.3ms)
+ [1m[36mAdvertSelector::Banner Load (0.4ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.051957') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 58ms (Views: 55.8ms | ActiveRecord: 1.5ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_index
+------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners"[0m
+ [1m[35mAdvertSelector::Banner Load (0.3ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.006255') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 11ms (Views: 10.3ms | ActiveRecord: 0.8ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_new
+----------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (18.4ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.021967') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 26ms (Views: 25.0ms | ActiveRecord: 0.8ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_show_banner
+--------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#show as HTML
+ Parameters: {"id"=>"394627963"}
+Redirected to http://test.host/advert_selector/banners/394627963/edit
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#update as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+Completed 500 Internal Server Error in 2ms
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+-----------------------------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner_running_view_count
+-----------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["running_view_count", 1], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Processing by AdvertSelector::BannersController#update_running_view_count as HTML
+ Parameters: {"banner"=>{"running_view_count"=>"99"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 1069ms (ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_forbidden_with_default_access
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+Filter chain halted as :admin_access_only rendered or redirected
+Completed 403 Forbidden in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_clear_errors_log
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::MainController#clear_errors_log as HTML
+Redirected to http://test.host/advert_selector/
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_get_index
+---------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.003708') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 7ms (Views: 6.1ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_array=
+-----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085[0m [["conflicting_placements_array", "not_found,video"], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'not_found' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'video' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_string_handling
+--------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_with
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------
+AdvertSelector::PlacementTest: test_name_sym
+--------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_create_placement
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+Processing by AdvertSelector::PlacementsController#create as HTML
+ Parameters: {"placement"=>{"name"=>"new placement"}}
+Completed 500 Internal Server Error in 0ms
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_destroy_placement
+-----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_placements"
+Processing by AdvertSelector::PlacementsController#destroy as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", "405688915"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ?[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements
+Completed 302 Found in 2ms (ActiveRecord: 0.3ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_edit
+--------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#edit as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (5.7ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.011527') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 14ms (Views: 13.0ms | ActiveRecord: 0.8ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_index
+---------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.005556') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 9ms (Views: 7.8ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_new
+-------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = '') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (3.5ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.007007') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 10ms (Views: 8.8ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_show_placement
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#show as HTML
+ Parameters: {"id"=>"405688915"}
+Redirected to http://test.host/advert_selector/placements/405688915/edit
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_update_placement
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#update as HTML
+ Parameters: {"placement"=>{"name"=>"Leaderboard"}, "id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+Completed 500 Internal Server Error in 1ms
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------
+AdvertSelectorTest: test_truth
+------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------
+BannerShowsTest: test_HelperItem_runned
+---------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.011877' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.012051' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 13ms (Views: 11.9ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "always_false"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.027318' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.027446' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------------------
+BannerShowsTest: test_HelperItem_with_raising_error_and_common_error_displays
+-----------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)[0m
+ [1m[35mSQL (0.2ms)[0m INSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?) [["banner_id", 814558298], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "raise_error"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007756' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007876' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Error with banner Coke in placement Leaderboard.
+2014-02-11T12:00:00+02:00 - http://www.example.com/ - {"controller"=>"examples", "action"=>"index"}
+#<ZeroDivisionError: divided by 0>
+
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `/'
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `advert_selector_raise_error'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:53:in `block in advert_selector_banner_try'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:49:in `advert_selector_banner_try'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:20:in `block (2 levels) in advert_selector_initialize'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:18:in `block in advert_selector_initialize'
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/advert_selector/placements" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.018414') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35mCACHE (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 405688915]]
+ [1m[36mCACHE (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 7ms (Views: 6.0ms | ActiveRecord: 0.4ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------
+BannerShowsTest: test_banner_frequency,_limit_frequency_within_one_week
+-----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "frequency" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["frequency", 2], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007505' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007645' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 9ms (Views: 8.2ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-14 10:00:00.019056' OR end_time IS NULL) AND (start_time < '2014-02-14 11:00:00.019174' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------------------------------
+BannerShowsTest: test_banner_preview_url_forces_banner_and_displays_information
+-------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007005' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007151' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+Started GET "/?advert_selector_force=207249520&advert_selector_force_stamp=1392076800" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+ Parameters: {"advert_selector_force"=>"207249520", "advert_selector_force_stamp"=>"1392076800"}
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = 207249520 LIMIT 1
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 718799085]]
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 207249520]]
+[AdvertSelector] ForceShowing banner parade_banner in placement Parade
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.016610' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.016770' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 4.8ms | ActiveRecord: 0.7ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------------------------------------------
+BannerShowsTest: test_complex_setup_conflicting_banners_placements
+------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520[0m [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008925' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.009077' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 2.1ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+---------------------------------------------------------------
+BannerShowsTest: test_complex_setup_multiple_banners_placements
+---------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520[0m [["confirmed", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1 [["id", 718799085]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085 [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915 [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'video') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 1019730477[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.013717' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.013866' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------
+BannerShowsTest: test_normal_request_and_banner_loading
+-------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.005987' OR end_time IS NULL) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:15:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------
+BannerShowsTest: test_only_once_per_session_banners
+---------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY position[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "only_once_per_session" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["only_once_per_session", true], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008517' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.008661' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+ExamplesControllerTest: test_render_video_once_per_session
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.001788' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.001933' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+Connecting to database specified by database.yml
+ [1m[36m (0.3ms)[0m [1mbegin transaction[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_placements"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Parade', 'leaderboard,video', '2014-02-11 18:42:14', '2014-02-11 18:42:14', 718799085)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Leaderboard', 'parade', '2014-02-11 18:42:14', '2014-02-11 18:42:14', 405688915)
+ [1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "only_once_per_session", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Video', 't', 'parade', '2014-02-11 18:42:14', '2014-02-11 18:42:14', 1019730477)[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_banners"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "running_view_count", "frequency", "fast_mode", "comment", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Coke', '2014-02-06 00:00:00.000000', '2014-02-16 00:00:00.000000', 1000, 100, 0, 'f', 'Coke banner', 't', 50, '2014-02-11 18:42:14', '2014-02-11 18:42:14', 814558298, 405688915)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "comment", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Pepsi', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 0, 'Pepsi banner', 't', 't', 100, '2014-02-11 18:42:14', '2014-02-11 18:42:14', 394627963, 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('parade_banner', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 1, 't', 'f', 1000, '2014-02-11 18:42:14', '2014-02-11 18:42:14', 207249520, 718799085)[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_helper_items"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "position", "created_at", "updated_at", "id", "banner_id") VALUES ('banner_leaderboard', 't', '<img src=''coke_banner''/>', 1, '2014-02-11 18:42:14', '2014-02-11 18:42:14', 929640376, 814558298)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES ('request_params_include?', 'f', 'pepsi=true', '2014-02-11 18:42:14', '2014-02-11 18:42:14', 435138789, 394627963)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (2, 'banner_leaderboard', 't', '<img src=''pepsi_banner''/>', '2014-02-11 18:42:14', '2014-02-11 18:42:14', 960656439, 394627963)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (1, 'banner_parade', 't', '<img src=''banner_parade''/>', '2014-02-11 18:42:14', '2014-02-11 18:42:14', 281932184, 207249520)
+ [1m[36m (32.2ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000119' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.001246' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.001378' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.002144' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.002719' OR end_time IS NULL) AND (start_time < '2013-02-11 11:00:00.002829' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 0, "updated_at" = '2014-02-11 10:00:00.001042' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 551, "updated_at" = '2014-02-11 10:00:00.006149' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 0, "target_view_count" = 10, "updated_at" = '2014-02-11 10:00:00.000562' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 10, "updated_at" = '2014-02-11 10:00:00.006577' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.000503' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 't', "updated_at" = '2014-02-11 10:00:00.002390' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = '2014-02-11 11:00:00.000354', "updated_at" = '2014-02-11 10:00:00.000769' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = '2014-02-11 08:00:00.002230', "end_time" = '2014-02-11 09:00:00.002317', "updated_at" = '2014-02-11 10:00:00.002628' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "start_time" = NULL, "end_time" = '2014-02-11 11:00:00.003438', "updated_at" = '2014-02-11 10:00:00.003761' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#create as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner", "end_time"=>"2014-02-21 00:00:00 UTC", "frequency"=>"0", "name"=>"Pepsi", "placement_id"=>"405688915", "start_time"=>"2014-02-11 00:00:00 UTC", "target_view_count"=>"1000"}}
+Completed 500 Internal Server Error in 0.7ms
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.2ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#destroy as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1 [["id", 435138789]]
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 435138789]]
+ [1m[35mAdvertSelector::HelperItem Load (0.0ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1 [["id", 960656439]]
+ [1m[36mSQL (0.0ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 960656439]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 394627963 AND position > 2)
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ?[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners
+Completed 302 Found in 6.1ms (ActiveRecord: 0.9ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" [0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#edit as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (47.1ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.059296') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 66.8ms (Views: 64.9ms | ActiveRecord: 1.1ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" [0m
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.006080') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 8.9ms (Views: 7.5ms | ActiveRecord: 0.6ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (14.9ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.019059') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 22.3ms (Views: 20.9ms | ActiveRecord: 0.7ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#show as HTML
+ Parameters: {"id"=>"394627963"}
+Redirected to http://test.host/advert_selector/banners/394627963/edit
+Completed 302 Found in 0.7ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (3.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#update as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+Completed 500 Internal Server Error in 1.2ms
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 1, "updated_at" = '2014-02-11 10:00:00.000917' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Processing by AdvertSelector::BannersController#update_running_view_count as HTML
+ Parameters: {"banner"=>{"running_view_count"=>"99"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mSQL (0.4ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 1076.1ms (ActiveRecord: 0.6ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.4ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+Filter chain halted as :admin_access_only rendered or redirected
+Completed 403 Forbidden in 1.1ms (Views: 0.7ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::MainController#clear_errors_log as HTML
+Redirected to http://test.host/advert_selector/
+Completed 302 Found in 0.8ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.003741') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 6.7ms (Views: 6.1ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = 'not_found,video', "updated_at" = '2014-02-11 10:00:00.005616' WHERE "advert_selector_placements"."id" = 718799085[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') LIMIT 1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = '', "updated_at" = '2014-02-11 10:00:00.007169' WHERE "advert_selector_placements"."id" = 405688915[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'not_found' LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'video' LIMIT 1
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements" [0m
+Processing by AdvertSelector::PlacementsController#create as HTML
+ Parameters: {"placement"=>{"name"=>"new placement"}}
+Completed 500 Internal Server Error in 0.4ms
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_placements"
+Processing by AdvertSelector::PlacementsController#destroy as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", "405688915"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mDELETE FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ?[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements
+Completed 302 Found in 2.4ms (ActiveRecord: 0.3ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements" [0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#edit as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (6.3ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.012145') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 15.0ms (Views: 13.4ms | ActiveRecord: 0.9ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.006803') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 9.8ms (Views: 8.4ms | ActiveRecord: 0.7ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = '') LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (3.6ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.008220') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 10.8ms (Views: 9.5ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#show as HTML
+ Parameters: {"id"=>"405688915"}
+Redirected to http://test.host/advert_selector/placements/405688915/edit
+Completed 302 Found in 0.5ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#update as HTML
+ Parameters: {"placement"=>{"name"=>"Leaderboard"}, "id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+Completed 500 Internal Server Error in 1.4ms
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001137' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003732' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.010101' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.010279' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 8.3ms (Views: 7.6ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001216' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.004699' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000878' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003599' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "frequency" = 2, "updated_at" = '2014-02-11 10:00:00.005180' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008227' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.008443' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5.0ms (Views: 4.5ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-14 10:00:00.017250' OR end_time IS NULL) AND (start_time < '2014-02-14 11:00:00.017428' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.5ms (Views: 4.0ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1.8ms (Views: 1.7ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001028' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003463' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.006283' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.006438' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.2ms (Views: 3.7ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/?advert_selector_force=207249520&advert_selector_force_stamp=1392076800" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+ Parameters: {"advert_selector_force"=>"207249520", "advert_selector_force_stamp"=>"1392076800"}
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = 207249520 LIMIT 1
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 ORDER BY position
+[AdvertSelector] ForceShowing banner parade_banner in placement Parade
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.025594' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.025758' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 7.0ms (Views: 6.0ms | ActiveRecord: 0.8ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001032' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.008113' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001020' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003393' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001467' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.004311' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.006285' OR end_time IS NULL) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.3ms (Views: 3.8ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1.9ms (Views: 1.8ms | ActiveRecord: 0.0ms)
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:15:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2.6ms (Views: 2.5ms | ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001040' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003579' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "only_once_per_session" = 't', "updated_at" = '2014-02-11 10:00:00.005752' WHERE "advert_selector_placements"."id" = 405688915[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008917' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.009207' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5.8ms (Views: 5.1ms | ActiveRecord: 0.6ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1.6ms (Views: 1.5ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.001767' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.001972' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5.1ms (Views: 4.5ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+Connecting to database specified by database.yml
+ [1m[36m (0.3ms)[0m [1mbegin transaction[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_placements"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Parade', 'leaderboard,video', '2014-02-11 18:42:37', '2014-02-11 18:42:37', 718799085)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Leaderboard', 'parade', '2014-02-11 18:42:37', '2014-02-11 18:42:37', 405688915)
+ [1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "only_once_per_session", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Video', 't', 'parade', '2014-02-11 18:42:37', '2014-02-11 18:42:37', 1019730477)[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_banners"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "running_view_count", "frequency", "fast_mode", "comment", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Coke', '2014-02-06 00:00:00.000000', '2014-02-16 00:00:00.000000', 1000, 100, 0, 'f', 'Coke banner', 't', 50, '2014-02-11 18:42:37', '2014-02-11 18:42:37', 814558298, 405688915)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "comment", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Pepsi', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 0, 'Pepsi banner', 't', 't', 100, '2014-02-11 18:42:37', '2014-02-11 18:42:37', 394627963, 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('parade_banner', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 1, 't', 'f', 1000, '2014-02-11 18:42:37', '2014-02-11 18:42:37', 207249520, 718799085)[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_helper_items"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "position", "created_at", "updated_at", "id", "banner_id") VALUES ('banner_leaderboard', 't', '<img src=''coke_banner''/>', 1, '2014-02-11 18:42:37', '2014-02-11 18:42:37', 929640376, 814558298)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES ('request_params_include?', 'f', 'pepsi=true', '2014-02-11 18:42:37', '2014-02-11 18:42:37', 435138789, 394627963)
+ [1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (2, 'banner_leaderboard', 't', '<img src=''pepsi_banner''/>', '2014-02-11 18:42:37', '2014-02-11 18:42:37', 960656439, 394627963)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (1, 'banner_parade', 't', '<img src=''banner_parade''/>', '2014-02-11 18:42:37', '2014-02-11 18:42:37', 281932184, 207249520)
+ [1m[36m (35.0ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE (advert_selector_helper_items.position IS NOT NULL) AND ("advert_selector_helper_items"."banner_id" = 814558298) ORDER BY advert_selector_helper_items.position DESC LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content", nil], ["content_for", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", nil], ["position", 2], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 10)
+ [1m[36mSQL (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content", nil], ["content_for", true], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "content_for_invalid"], ["position", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content", nil], ["content_for", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "some_limit_helper_here"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656440]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656440]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position > 3)[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position LIMIT 1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000111' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000834' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.000943' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.001631' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.002145' OR end_time IS NULL) AND (start_time < '2013-02-11 11:00:00.002249' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 0, "updated_at" = '2014-02-11 10:00:00.000905' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 551, "updated_at" = '2014-02-11 10:00:00.005541' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 0, "target_view_count" = 10, "updated_at" = '2014-02-11 10:00:00.000645' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 10, "updated_at" = '2014-02-11 10:00:00.003074' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.000454' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 't', "updated_at" = '2014-02-11 10:00:00.002369' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = '2014-02-11 11:00:00.000393', "updated_at" = '2014-02-11 10:00:00.000794' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = '2014-02-11 08:00:00.002215', "end_time" = '2014-02-11 09:00:00.002318', "updated_at" = '2014-02-11 10:00:00.002635' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "start_time" = NULL, "end_time" = '2014-02-11 11:00:00.003538', "updated_at" = '2014-02-11 10:00:00.003866' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#create as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner", "end_time"=>"2014-02-21 00:00:00 UTC", "frequency"=>"0", "name"=>"Pepsi", "placement_id"=>"405688915", "start_time"=>"2014-02-11 00:00:00 UTC", "target_view_count"=>"1000"}}
+Completed 500 Internal Server Error in 0.5ms
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.2ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#destroy as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1 [["id", 435138789]]
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 435138789]]
+ [1m[35mAdvertSelector::HelperItem Load (0.0ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1 [["id", 960656439]]
+ [1m[36mSQL (0.0ms)[0m [1mDELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ?[0m [["id", 960656439]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 394627963 AND position > 2)
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ?[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners
+Completed 302 Found in 5.1ms (ActiveRecord: 0.8ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" [0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#edit as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (46.3ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.062063') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 65.8ms (Views: 64.2ms | ActiveRecord: 0.9ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" [0m
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.006107') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 9.1ms (Views: 7.8ms | ActiveRecord: 0.6ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (15.3ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.019403') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 26.0ms (Views: 24.5ms | ActiveRecord: 0.7ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#show as HTML
+ Parameters: {"id"=>"394627963"}
+Redirected to http://test.host/advert_selector/banners/394627963/edit
+Completed 302 Found in 0.5ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#update as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+Completed 500 Internal Server Error in 1.1ms
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 1, "updated_at" = '2014-02-11 10:00:00.000951' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Processing by AdvertSelector::BannersController#update_running_view_count as HTML
+ Parameters: {"banner"=>{"running_view_count"=>"99"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mSQL (0.4ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 1078.9ms (ActiveRecord: 0.6ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.2ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+Filter chain halted as :admin_access_only rendered or redirected
+Completed 403 Forbidden in 1.2ms (Views: 0.7ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::MainController#clear_errors_log as HTML
+Redirected to http://test.host/advert_selector/
+Completed 302 Found in 0.9ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.004148') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 10.7ms (Views: 9.9ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = 'not_found,video', "updated_at" = '2014-02-11 10:00:00.001513' WHERE "advert_selector_placements"."id" = 718799085[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') LIMIT 1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = '', "updated_at" = '2014-02-11 10:00:00.002873' WHERE "advert_selector_placements"."id" = 405688915[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'not_found' LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'video' LIMIT 1
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements" [0m
+Processing by AdvertSelector::PlacementsController#create as HTML
+ Parameters: {"placement"=>{"name"=>"new placement"}}
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_placements" ("conflicting_placements_array", "created_at", "name", "only_once_per_session", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["conflicting_placements_array", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "new placement"], ["only_once_per_session", nil], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements/1019730478
+Completed 302 Found in 3.6ms (ActiveRecord: 0.4ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements" [0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_placements"
+Processing by AdvertSelector::PlacementsController#destroy as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", "405688915"]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ?[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements
+Completed 302 Found in 1.8ms (ActiveRecord: 0.2ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements" [0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#edit as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (5.1ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.010568') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 12.6ms (Views: 11.3ms | ActiveRecord: 0.7ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.006447') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 8.6ms (Views: 7.3ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = '') LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (3.1ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.006790') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 9.2ms (Views: 8.2ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#show as HTML
+ Parameters: {"id"=>"405688915"}
+Redirected to http://test.host/advert_selector/placements/405688915/edit
+Completed 302 Found in 0.5ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#update as HTML
+ Parameters: {"placement"=>{"name"=>"Leaderboard"}, "id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements/405688915
+Completed 302 Found in 1.8ms (ActiveRecord: 0.2ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001034' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003391' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.010151' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.010328' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 7.9ms (Views: 7.2ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content", nil], ["content_for", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "always_false"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.021147' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.021371' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.3ms (Views: 3.7ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000922' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003147' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)[0m
+ [1m[35mSQL (0.2ms)[0m INSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["banner_id", 814558298], ["content", nil], ["content_for", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "raise_error"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007346' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007511' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Error with banner Coke in placement Leaderboard.
+2014-02-11T12:00:00+02:00 - http://www.example.com/ - {"controller"=>"examples", "action"=>"index"}
+#<ZeroDivisionError: divided by 0>
+
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `/'
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `advert_selector_raise_error'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:53:in `block in advert_selector_banner_try'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.16/lib/active_record/associations/collection_proxy.rb:91:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.16/lib/active_record/associations/collection_proxy.rb:91:in `method_missing'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:49:in `advert_selector_banner_try'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:20:in `block (2 levels) in advert_selector_initialize'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.16/lib/active_record/relation/delegation.rb:6:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.16/lib/active_record/relation/delegation.rb:6:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:18:in `block in advert_selector_initialize'
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.7ms (Views: 4.2ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/advert_selector/placements" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.019821') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mCACHE (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mCACHE (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 12.3ms (Views: 11.3ms | ActiveRecord: 0.4ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000948' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003284' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "frequency" = 2, "updated_at" = '2014-02-11 10:00:00.004693' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.011139' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.011312' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.6ms (Views: 4.1ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.3ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-14 10:00:00.020540' OR end_time IS NULL) AND (start_time < '2014-02-14 11:00:00.020707' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5.0ms (Views: 4.3ms | ActiveRecord: 0.6ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1.4ms (Views: 1.2ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000975' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003380' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.006285' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.006430' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.2ms (Views: 3.7ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.3ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/?advert_selector_force=207249520&advert_selector_force_stamp=1392076800" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+ Parameters: {"advert_selector_force"=>"207249520", "advert_selector_force_stamp"=>"1392076800"}
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = 207249520 LIMIT 1
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 ORDER BY position
+[AdvertSelector] ForceShowing banner parade_banner in placement Parade
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.015663' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.015815' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6.4ms (Views: 5.5ms | ActiveRecord: 0.8ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000900' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003269' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000939' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.004372' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001192' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.004173' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.006330' OR end_time IS NULL) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.9ms (Views: 4.2ms | ActiveRecord: 0.6ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2.1ms (Views: 1.9ms | ActiveRecord: 0.0ms)
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:15:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2.0ms (Views: 1.9ms | ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001101' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.004112' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "only_once_per_session" = 't', "updated_at" = '2014-02-11 10:00:00.006573' WHERE "advert_selector_placements"."id" = 405688915[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008947' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.009123' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5.1ms (Views: 4.5ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1.5ms (Views: 1.4ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.001981' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.002168' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5.5ms (Views: 4.9ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+Connecting to database specified by database.yml
+ [1m[36m (0.3ms)[0m [1mbegin transaction[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_placements"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Parade', 'leaderboard,video', '2014-02-11 18:42:52', '2014-02-11 18:42:52', 718799085)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Leaderboard', 'parade', '2014-02-11 18:42:52', '2014-02-11 18:42:52', 405688915)
+ [1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "only_once_per_session", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Video', 't', 'parade', '2014-02-11 18:42:52', '2014-02-11 18:42:52', 1019730477)[0m
+ [1m[35mFixture Delete (0.0ms)[0m DELETE FROM "advert_selector_banners"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "running_view_count", "frequency", "fast_mode", "comment", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Coke', '2014-02-06 00:00:00.000000', '2014-02-16 00:00:00.000000', 1000, 100, 0, 'f', 'Coke banner', 't', 50, '2014-02-11 18:42:52', '2014-02-11 18:42:52', 814558298, 405688915)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "comment", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Pepsi', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 0, 'Pepsi banner', 't', 't', 100, '2014-02-11 18:42:52', '2014-02-11 18:42:52', 394627963, 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('parade_banner', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 1, 't', 'f', 1000, '2014-02-11 18:42:52', '2014-02-11 18:42:52', 207249520, 718799085)[0m
+ [1m[35mFixture Delete (0.0ms)[0m DELETE FROM "advert_selector_helper_items"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "position", "created_at", "updated_at", "id", "banner_id") VALUES ('banner_leaderboard', 't', '<img src=''coke_banner''/>', 1, '2014-02-11 18:42:52', '2014-02-11 18:42:52', 929640376, 814558298)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES ('request_params_include?', 'f', 'pepsi=true', '2014-02-11 18:42:52', '2014-02-11 18:42:52', 435138789, 394627963)
+ [1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (2, 'banner_leaderboard', 't', '<img src=''pepsi_banner''/>', '2014-02-11 18:42:52', '2014-02-11 18:42:52', 960656439, 394627963)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (1, 'banner_parade', 't', '<img src=''banner_parade''/>', '2014-02-11 18:42:52', '2014-02-11 18:42:52', 281932184, 207249520)
+ [1m[36m (52.1ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE (advert_selector_helper_items.position IS NOT NULL) AND ("advert_selector_helper_items"."banner_id" = 814558298) ORDER BY advert_selector_helper_items.position DESC LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content", nil], ["content_for", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", nil], ["position", 2], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 10)
+ [1m[36mSQL (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content", nil], ["content_for", true], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "content_for_invalid"], ["position", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content", nil], ["content_for", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "some_limit_helper_here"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656440]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656440]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position > 3)[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position LIMIT 1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000113' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000815' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.000925' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.001666' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.002202' OR end_time IS NULL) AND (start_time < '2013-02-11 11:00:00.002307' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 0, "updated_at" = '2014-02-11 10:00:00.000863' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 551, "updated_at" = '2014-02-11 10:00:00.005510' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 0, "target_view_count" = 10, "updated_at" = '2014-02-11 10:00:00.000718' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 10, "updated_at" = '2014-02-11 10:00:00.003233' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.000372' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 't', "updated_at" = '2014-02-11 10:00:00.002752' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = '2014-02-11 11:00:00.000346', "updated_at" = '2014-02-11 10:00:00.000750' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = '2014-02-11 08:00:00.002134', "end_time" = '2014-02-11 09:00:00.002225', "updated_at" = '2014-02-11 10:00:00.002524' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "start_time" = NULL, "end_time" = '2014-02-11 11:00:00.003386', "updated_at" = '2014-02-11 10:00:00.003666' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "start_time" = '2014-02-10 22:00:00.000000', "end_time" = '2014-02-15 14:00:00.000000', "updated_at" = '2014-02-11 10:00:00.000638' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 0, "updated_at" = '2014-02-11 10:00:00.002280' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "start_time" = '2014-02-10 22:00:00.000000', "end_time" = '2014-02-21 00:00:00.000000', "updated_at" = '2014-02-11 10:00:00.000731' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 0, "updated_at" = '2014-02-11 10:00:00.002340' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "start_time" = '2014-02-11 16:00:00.000000', "updated_at" = '2014-02-11 17:00:00.001474' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = '2014-02-10 22:00:00.000000', "end_time" = '2014-02-15 14:00:00.000000', "updated_at" = '2014-02-11 10:00:00.000699' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 0, "updated_at" = '2014-02-11 10:00:00.002445' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#create as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner", "end_time"=>"2014-02-21 00:00:00 UTC", "frequency"=>"0", "name"=>"Pepsi", "placement_id"=>"405688915", "start_time"=>"2014-02-11 00:00:00 UTC", "target_view_count"=>"1000"}}
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m INSERT INTO "advert_selector_banners" ("comment", "confirmed", "created_at", "end_time", "fast_mode", "frequency", "name", "placement_id", "priority", "running_view_count", "start_time", "target_view_count", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["comment", "Pepsi banner"], ["confirmed", false], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["end_time", Fri, 21 Feb 2014 00:00:00 UTC +00:00], ["fast_mode", false], ["frequency", 0], ["name", "Pepsi"], ["placement_id", 405688915], ["priority", 0], ["running_view_count", 0], ["start_time", Tue, 11 Feb 2014 00:00:00 UTC +00:00], ["target_view_count", 1000], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558299 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners/814558299
+Completed 302 Found in 5.1ms (ActiveRecord: 0.5ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" [0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" [0m
+Processing by AdvertSelector::BannersController#destroy as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36mAdvertSelector::HelperItem Load (0.0ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 435138789]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 435138789]]
+ [1m[36mAdvertSelector::HelperItem Load (0.0ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656439]]
+ [1m[35mSQL (0.0ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656439]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 394627963 AND position > 2)[0m
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/advert_selector/banners
+Completed 302 Found in 4.5ms (ActiveRecord: 0.7ms)
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#edit as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (45.6ms)
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.057666') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 61.7ms (Views: 59.8ms | ActiveRecord: 1.0ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#index as HTML
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.006697') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 12.9ms (Views: 11.4ms | ActiveRecord: 0.7ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#new as HTML
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (15.6ms)
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.019777') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 22.7ms (Views: 21.3ms | ActiveRecord: 0.7ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#show as HTML
+ Parameters: {"id"=>"394627963"}
+Redirected to http://test.host/advert_selector/banners/394627963/edit
+Completed 302 Found in 0.6ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#update as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner"}, "id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 2.7ms (ActiveRecord: 0.3ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 1, "updated_at" = '2014-02-11 10:00:00.000903' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Processing by AdvertSelector::BannersController#update_running_view_count as HTML
+ Parameters: {"banner"=>{"running_view_count"=>"99"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mSQL (0.4ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 1074.5ms (ActiveRecord: 0.6ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+Filter chain halted as :admin_access_only rendered or redirected
+Completed 403 Forbidden in 0.9ms (Views: 0.6ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::MainController#clear_errors_log as HTML
+Redirected to http://test.host/advert_selector/
+Completed 302 Found in 0.8ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.003446') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 6.1ms (Views: 5.5ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = 'not_found,video', "updated_at" = '2014-02-11 10:00:00.001774' WHERE "advert_selector_placements"."id" = 718799085[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') LIMIT 1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = '', "updated_at" = '2014-02-11 10:00:00.003429' WHERE "advert_selector_placements"."id" = 405688915[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'not_found' LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'video' LIMIT 1
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements" [0m
+Processing by AdvertSelector::PlacementsController#create as HTML
+ Parameters: {"placement"=>{"name"=>"new placement"}}
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_placements" ("conflicting_placements_array", "created_at", "name", "only_once_per_session", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["conflicting_placements_array", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "new placement"], ["only_once_per_session", nil], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements/1019730478
+Completed 302 Found in 2.8ms (ActiveRecord: 0.3ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements" [0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_placements"
+Processing by AdvertSelector::PlacementsController#destroy as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", "405688915"]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mDELETE FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ?[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements
+Completed 302 Found in 1.6ms (ActiveRecord: 0.2ms)
+ [1m[36m (0.0ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements" [0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#edit as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (5.0ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.010662') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 12.6ms (Views: 11.2ms | ActiveRecord: 0.7ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.005355') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 7.6ms (Views: 6.5ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = '') LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (3.7ms)
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.007851') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 10.2ms (Views: 9.1ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#show as HTML
+ Parameters: {"id"=>"405688915"}
+Redirected to http://test.host/advert_selector/placements/405688915/edit
+Completed 302 Found in 0.6ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#update as HTML
+ Parameters: {"placement"=>{"name"=>"Leaderboard"}, "id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements/405688915
+Completed 302 Found in 1.8ms (ActiveRecord: 0.1ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001005' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.008023' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.015331' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.015559' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 9.3ms (Views: 8.6ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content", nil], ["content_for", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "always_false"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.028740' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.028898' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.5ms (Views: 3.9ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000947' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003317' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)[0m
+ [1m[35mSQL (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["banner_id", 814558298], ["content", nil], ["content_for", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "raise_error"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008153' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.008341' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Error with banner Coke in placement Leaderboard.
+2014-02-11T12:00:00+02:00 - http://www.example.com/ - {"controller"=>"examples", "action"=>"index"}
+#<ZeroDivisionError: divided by 0>
+
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `/'
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `advert_selector_raise_error'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:53:in `block in advert_selector_banner_try'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.16/lib/active_record/associations/collection_proxy.rb:91:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.16/lib/active_record/associations/collection_proxy.rb:91:in `method_missing'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:49:in `advert_selector_banner_try'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:20:in `block (2 levels) in advert_selector_initialize'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.16/lib/active_record/relation/delegation.rb:6:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.16/lib/active_record/relation/delegation.rb:6:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:18:in `block in advert_selector_initialize'
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5.1ms (Views: 4.5ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/advert_selector/placements" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.022084') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mCACHE (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mCACHE (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 13.8ms (Views: 12.7ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001033' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003634' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "frequency" = 2, "updated_at" = '2014-02-11 10:00:00.005197' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007729' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007915' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.8ms (Views: 4.2ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-14 10:00:00.016466' OR end_time IS NULL) AND (start_time < '2014-02-14 11:00:00.016688' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5.2ms (Views: 4.5ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1.6ms (Views: 1.5ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000916' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003556' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.006634' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.006783' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.3ms (Views: 3.8ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/?advert_selector_force=207249520&advert_selector_force_stamp=1392076800" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+ Parameters: {"advert_selector_force"=>"207249520", "advert_selector_force_stamp"=>"1392076800"}
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = 207249520 LIMIT 1
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 ORDER BY position
+[AdvertSelector] ForceShowing banner parade_banner in placement Parade
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.015445' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.015588' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6.0ms (Views: 5.2ms | ActiveRecord: 0.7ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000832' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.002991' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 't', "updated_at" = '2014-02-11 10:00:00.004458' WHERE "advert_selector_banners"."id" = 207249520[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007061' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007195' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.2ms (Views: 3.7ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2.0ms (Views: 1.9ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001061' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003180' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 't', "updated_at" = '2014-02-11 10:00:00.004767' WHERE "advert_selector_banners"."id" = 207249520[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = '', "updated_at" = '2014-02-11 10:00:00.007200' WHERE "advert_selector_placements"."id" = 718799085
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') LIMIT 1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = '', "updated_at" = '2014-02-11 10:00:00.008499' WHERE "advert_selector_placements"."id" = 405688915
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'video') LIMIT 1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = '', "updated_at" = '2014-02-11 10:00:00.009849' WHERE "advert_selector_placements"."id" = 1019730477[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') LIMIT 1
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.012386' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.012528' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.6ms (Views: 4.2ms | ActiveRecord: 0.3ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001017' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003195' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.004922' OR end_time IS NULL) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 3.9ms (Views: 3.3ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2.5ms (Views: 2.3ms | ActiveRecord: 0.0ms)
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:15:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2.1ms (Views: 1.9ms | ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000893' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003318' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "only_once_per_session" = 't', "updated_at" = '2014-02-11 10:00:00.005385' WHERE "advert_selector_placements"."id" = 405688915[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007509' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007700' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.3ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5.3ms (Views: 4.5ms | ActiveRecord: 0.7ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1.3ms (Views: 1.2ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.002212' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.002377' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5.1ms (Views: 4.4ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+Connecting to database specified by database.yml
+ [1m[36m (0.3ms)[0m [1mbegin transaction[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_placements"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Parade', 'leaderboard,video', '2014-02-11 18:43:59', '2014-02-11 18:43:59', 718799085)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Leaderboard', 'parade', '2014-02-11 18:43:59', '2014-02-11 18:43:59', 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "only_once_per_session", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Video', 't', 'parade', '2014-02-11 18:43:59', '2014-02-11 18:43:59', 1019730477)[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_banners"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "running_view_count", "frequency", "fast_mode", "comment", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Coke', '2014-02-06 00:00:00.000000', '2014-02-16 00:00:00.000000', 1000, 100, 0, 'f', 'Coke banner', 't', 50, '2014-02-11 18:43:59', '2014-02-11 18:43:59', 814558298, 405688915)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "comment", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Pepsi', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 0, 'Pepsi banner', 't', 't', 100, '2014-02-11 18:43:59', '2014-02-11 18:43:59', 394627963, 405688915)
+ [1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('parade_banner', '2014-02-11 00:00:00.000000', '2014-02-21 00:00:00.000000', 1000, 1, 't', 'f', 1000, '2014-02-11 18:43:59', '2014-02-11 18:43:59', 207249520, 718799085)[0m
+ [1m[35mFixture Delete (0.0ms)[0m DELETE FROM "advert_selector_helper_items"
+ [1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "position", "created_at", "updated_at", "id", "banner_id") VALUES ('banner_leaderboard', 't', '<img src=''coke_banner''/>', 1, '2014-02-11 18:43:59', '2014-02-11 18:43:59', 929640376, 814558298)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES ('request_params_include?', 'f', 'pepsi=true', '2014-02-11 18:43:59', '2014-02-11 18:43:59', 435138789, 394627963)
+ [1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (2, 'banner_leaderboard', 't', '<img src=''pepsi_banner''/>', '2014-02-11 18:43:59', '2014-02-11 18:43:59', 960656439, 394627963)[0m
+ [1m[35mFixture Insert (0.0ms)[0m INSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (1, 'banner_parade', 't', '<img src=''banner_parade''/>', '2014-02-11 18:43:59', '2014-02-11 18:43:59', 281932184, 207249520)
+ [1m[36m (35.5ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (2.7ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE (advert_selector_helper_items.position IS NOT NULL) AND ("advert_selector_helper_items"."banner_id" = 814558298) ORDER BY advert_selector_helper_items.position DESC LIMIT 1
+ [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content", nil], ["content_for", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", nil], ["position", 2], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 10)
+ [1m[36mSQL (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content", nil], ["content_for", true], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "content_for_invalid"], ["position", 10], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content", nil], ["content_for", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "some_limit_helper_here"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656440]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656440]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position > 3)[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position LIMIT 1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000105' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.000760' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.000872' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.001514' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-02-11 10:00:00.002038' OR end_time IS NULL) AND (start_time < '2013-02-11 11:00:00.002144' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 0, "updated_at" = '2014-02-11 10:00:00.000650' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 551, "updated_at" = '2014-02-11 10:00:00.004898' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 0, "target_view_count" = 10, "updated_at" = '2014-02-11 10:00:00.000613' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 10, "updated_at" = '2014-02-11 10:00:00.002835' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.000328' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 't', "updated_at" = '2014-02-11 10:00:00.001829' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = '2014-02-11 11:00:00.000308', "updated_at" = '2014-02-11 10:00:00.000656' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = '2014-02-11 08:00:00.002413', "end_time" = '2014-02-11 09:00:00.002505', "updated_at" = '2014-02-11 10:00:00.002841' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "start_time" = NULL, "end_time" = '2014-02-11 11:00:00.003722', "updated_at" = '2014-02-11 10:00:00.003985' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "start_time" = '2014-02-10 22:00:00.000000', "end_time" = '2014-02-15 14:00:00.000000', "updated_at" = '2014-02-11 10:00:00.000584' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 0, "updated_at" = '2014-02-11 10:00:00.001996' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "start_time" = '2014-02-10 22:00:00.000000', "end_time" = '2014-02-21 00:00:00.000000', "updated_at" = '2014-02-11 10:00:00.000641' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 0, "updated_at" = '2014-02-11 10:00:00.002011' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "start_time" = '2014-02-11 16:00:00.000000', "updated_at" = '2014-02-11 17:00:00.001107' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = '2014-02-10 22:00:00.000000', "end_time" = '2014-02-15 14:00:00.000000', "updated_at" = '2014-02-11 10:00:00.000518' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 0, "updated_at" = '2014-02-11 10:00:00.001902' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#create as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner", "end_time"=>"2014-02-21 00:00:00 UTC", "frequency"=>"0", "name"=>"Pepsi", "placement_id"=>"405688915", "start_time"=>"2014-02-11 00:00:00 UTC", "target_view_count"=>"1000"}}
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m INSERT INTO "advert_selector_banners" ("comment", "confirmed", "created_at", "end_time", "fast_mode", "frequency", "name", "placement_id", "priority", "running_view_count", "start_time", "target_view_count", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["comment", "Pepsi banner"], ["confirmed", false], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["end_time", Fri, 21 Feb 2014 00:00:00 UTC +00:00], ["fast_mode", false], ["frequency", 0], ["name", "Pepsi"], ["placement_id", 405688915], ["priority", 0], ["running_view_count", 0], ["start_time", Tue, 11 Feb 2014 00:00:00 UTC +00:00], ["target_view_count", 1000], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558299 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners/814558299
+Completed 302 Found in 6.6ms (ActiveRecord: 0.6ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" [0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" [0m
+Processing by AdvertSelector::BannersController#destroy as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36mAdvertSelector::HelperItem Load (0.0ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 435138789]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 435138789]]
+ [1m[36mAdvertSelector::HelperItem Load (0.0ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656439]]
+ [1m[35mSQL (0.0ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656439]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 394627963 AND position > 2)[0m
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/advert_selector/banners
+Completed 302 Found in 4.2ms (ActiveRecord: 0.6ms)
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#edit as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (131.0ms)
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.164052') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 169.0ms (Views: 167.3ms | ActiveRecord: 0.9ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#index as HTML
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.005767') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 8.8ms (Views: 7.4ms | ActiveRecord: 0.7ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#new as HTML
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (13.2ms)
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.017270') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 20.5ms (Views: 19.1ms | ActiveRecord: 0.6ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#show as HTML
+ Parameters: {"id"=>"394627963"}
+Redirected to http://test.host/advert_selector/banners/394627963/edit
+Completed 302 Found in 0.7ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#update as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner"}, "id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 2.6ms (ActiveRecord: 0.2ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 1, "updated_at" = '2014-02-11 10:00:00.000841' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Processing by AdvertSelector::BannersController#update_running_view_count as HTML
+ Parameters: {"banner"=>{"running_view_count"=>"99"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mSQL (0.4ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 1105.9ms (ActiveRecord: 0.6ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+Filter chain halted as :admin_access_only rendered or redirected
+Completed 403 Forbidden in 1.9ms (Views: 1.5ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::MainController#clear_errors_log as HTML
+Redirected to http://test.host/advert_selector/
+Completed 302 Found in 1.0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.003334') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 6.3ms (Views: 5.7ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = 'not_found,video', "updated_at" = '2014-02-11 10:00:00.001557' WHERE "advert_selector_placements"."id" = 718799085[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') LIMIT 1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = '', "updated_at" = '2014-02-11 10:00:00.003064' WHERE "advert_selector_placements"."id" = 405688915[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'not_found' LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'video' LIMIT 1
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements" [0m
+Processing by AdvertSelector::PlacementsController#create as HTML
+ Parameters: {"placement"=>{"name"=>"new placement"}}
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_placements" ("conflicting_placements_array", "created_at", "name", "only_once_per_session", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["conflicting_placements_array", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "new placement"], ["only_once_per_session", nil], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements/1019730478
+Completed 302 Found in 3.2ms (ActiveRecord: 0.3ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements" [0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_placements"
+Processing by AdvertSelector::PlacementsController#destroy as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", "405688915"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mDELETE FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ?[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements
+Completed 302 Found in 2.5ms (ActiveRecord: 0.3ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements" [0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#edit as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (4.7ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.009809') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 12.0ms (Views: 10.5ms | ActiveRecord: 0.7ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.005620') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (1.5ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 33.5ms (Views: 30.7ms | ActiveRecord: 2.1ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = '') LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (3.8ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.008051') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 10.4ms (Views: 9.3ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#show as HTML
+ Parameters: {"id"=>"405688915"}
+Redirected to http://test.host/advert_selector/placements/405688915/edit
+Completed 302 Found in 0.6ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#update as HTML
+ Parameters: {"placement"=>{"name"=>"Leaderboard"}, "id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements/405688915
+Completed 302 Found in 1.8ms (ActiveRecord: 0.1ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001167' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.004161' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.032736' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.032953' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 12.8ms (Views: 11.8ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content", nil], ["content_for", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "always_false"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.048162' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.048332' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 20.6ms (Views: 19.9ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001017' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003502' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 0)[0m
+ [1m[35mSQL (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("banner_id", "content", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["banner_id", 814558298], ["content", nil], ["content_for", nil], ["created_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00], ["name", "raise_error"], ["position", 0], ["updated_at", Tue, 11 Feb 2014 10:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008177' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.008357' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Error with banner Coke in placement Leaderboard.
+2014-02-11T12:00:00+02:00 - http://www.example.com/ - {"controller"=>"examples", "action"=>"index"}
+#<ZeroDivisionError: divided by 0>
+
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `/'
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `advert_selector_raise_error'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:53:in `block in advert_selector_banner_try'
+/home/ohu/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.16/lib/active_record/associations/collection_proxy.rb:91:in `each'
+/home/ohu/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.16/lib/active_record/associations/collection_proxy.rb:91:in `method_missing'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:49:in `advert_selector_banner_try'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:20:in `block (2 levels) in advert_selector_initialize'
+/home/ohu/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.16/lib/active_record/relation/delegation.rb:6:in `each'
+/home/ohu/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.16/lib/active_record/relation/delegation.rb:6:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:18:in `block in advert_selector_initialize'
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5.2ms (Views: 4.7ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/advert_selector/placements" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-02-09 10:00:00.021484') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35mCACHE (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1
+ [1m[36mCACHE (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" [0m
+Completed 200 OK in 33.9ms (Views: 32.7ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000989' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003553' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "frequency" = 2, "updated_at" = '2014-02-11 10:00:00.005037' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.007454' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.007622' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.6ms (Views: 4.1ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-14 10:00:00.015832' OR end_time IS NULL) AND (start_time < '2014-02-14 11:00:00.016011' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5.3ms (Views: 4.7ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-14 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1.4ms (Views: 1.3ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000934' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003281' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.006367' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.006541' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.8ms (Views: 4.3ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/?advert_selector_force=207249520&advert_selector_force_stamp=1392076800" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+ Parameters: {"advert_selector_force"=>"207249520", "advert_selector_force_stamp"=>"1392076800"}
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = 207249520 LIMIT 1
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 ORDER BY position
+[AdvertSelector] ForceShowing banner parade_banner in placement Parade
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.016109' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.016273' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5.5ms (Views: 4.8ms | ActiveRecord: 0.6ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001068' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.023467' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 't', "updated_at" = '2014-02-11 10:00:00.025730' WHERE "advert_selector_banners"."id" = 207249520[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.029456' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.029631' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5.1ms (Views: 4.6ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2.3ms (Views: 2.2ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000931' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003406' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 't', "updated_at" = '2014-02-11 10:00:00.004908' WHERE "advert_selector_banners"."id" = 207249520[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 718799085 LIMIT 1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = '', "updated_at" = '2014-02-11 10:00:00.006798' WHERE "advert_selector_placements"."id" = 718799085
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') LIMIT 1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = '', "updated_at" = '2014-02-11 10:00:00.007838' WHERE "advert_selector_placements"."id" = 405688915
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'video') LIMIT 1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = '', "updated_at" = '2014-02-11 10:00:00.009223' WHERE "advert_selector_placements"."id" = 1019730477[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') LIMIT 1
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.012369' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.012564' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6.2ms (Views: 5.6ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 207249520 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.000909' WHERE "advert_selector_banners"."id" = 814558298
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.003256' WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.005156' OR end_time IS NULL) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.1ms (Views: 3.6ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2.1ms (Views: 1.9ms | ActiveRecord: 0.0ms)
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:15:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1.7ms (Views: 1.6ms | ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = 't', "updated_at" = '2014-02-11 10:00:00.001232' WHERE "advert_selector_banners"."id" = 814558298[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 ORDER BY position
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = 'f', "updated_at" = '2014-02-11 10:00:00.004061' WHERE "advert_selector_banners"."id" = 394627963
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 394627963 ORDER BY position[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = 405688915 LIMIT 1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "only_once_per_session" = 't', "updated_at" = '2014-02-11 10:00:00.006139' WHERE "advert_selector_placements"."id" = 405688915[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.008636' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.008800' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.6ms (Views: 4.1ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1
+Started GET "/" for 127.0.0.1 at 2014-02-11 12:00:00 +0200
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1.4ms (Views: 1.3ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = 814558298 AND "advert_selector_helper_items"."content_for" = 't' ORDER BY position DESC LIMIT 1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-02-11 10:00:00.001663' OR end_time IS NULL) AND (start_time < '2014-02-11 11:00:00.001824' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY position[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4.7ms (Views: 4.2ms | ActiveRecord: 0.4ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.4ms)[0m [1mbegin transaction[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_placements"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Parade', 'leaderboard,video', '2014-07-29 09:26:20', '2014-07-29 09:26:20', 718799085)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Leaderboard', 'parade', '2014-07-29 09:26:20', '2014-07-29 09:26:20', 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "only_once_per_session", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Video', 't', 'parade', '2014-07-29 09:26:20', '2014-07-29 09:26:20', 1019730477)[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_banners"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "running_view_count", "frequency", "fast_mode", "comment", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Coke', '2014-07-24 00:00:00.000000', '2014-08-03 00:00:00.000000', 1000, 100, 0, 'f', 'Coke banner', 't', 50, '2014-07-29 09:26:20', '2014-07-29 09:26:20', 814558298, 405688915)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "comment", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Pepsi', '2014-07-29 00:00:00.000000', '2014-08-08 00:00:00.000000', 1000, 0, 'Pepsi banner', 't', 't', 100, '2014-07-29 09:26:20', '2014-07-29 09:26:20', 394627963, 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('parade_banner', '2014-07-29 00:00:00.000000', '2014-08-08 00:00:00.000000', 1000, 1, 't', 'f', 1000, '2014-07-29 09:26:20', '2014-07-29 09:26:20', 207249520, 718799085)[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_helper_items"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "position", "created_at", "updated_at", "id", "banner_id") VALUES ('banner_leaderboard', 't', '<img src=''coke_banner''/>', 1, '2014-07-29 09:26:20', '2014-07-29 09:26:20', 929640376, 814558298)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES ('request_params_include?', 'f', 'pepsi=true', '2014-07-29 09:26:20', '2014-07-29 09:26:20', 435138789, 394627963)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (2, 'banner_leaderboard', 't', '<img src=''pepsi_banner''/>', '2014-07-29 09:26:20', '2014-07-29 09:26:20', 960656439, 394627963)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (1, 'banner_parade', 't', '<img src=''banner_parade''/>', '2014-07-29 09:26:20', '2014-07-29 09:26:20', 281932184, 207249520)
+ [1m[36m (43.2ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+--------------------------------------------
+AdvertSelector::BannerTest: test_HelperItems
+--------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE (advert_selector_helper_items.position IS NOT NULL) AND ("advert_selector_helper_items"."banner_id" = 814558298) ORDER BY advert_selector_helper_items.position DESC LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "position", "updated_at") VALUES (?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["position", 2], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 10)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content_for", true], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["name", "content_for_invalid"], ["position", 10], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 1)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["name", "some_limit_helper_here"], ["position", 1], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656440]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656440]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position > 3)[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------------------
+AdvertSelector::BannerTest: test_find_future_&&_find_current_scopes
+-------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.000105' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.000867' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.000977' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-07-29 09:00:00.001760' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-07-29 09:00:00.002301' OR end_time IS NULL) AND (start_time < '2013-07-29 10:00:00.002406' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------
+AdvertSelector::BannerTest: test_name_sym
+-----------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.4ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.5ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 551], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+--------------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount_reaching_target
+--------------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "target_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["target_view_count", 10], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 10], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_for_default_banners
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_time_usages
+------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 29 Jul 2014 10:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 29 Jul 2014 07:00:00 UTC +00:00], ["end_time", Tue, 29 Jul 2014 08:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", nil], ["end_time", Tue, 29 Jul 2014 10:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_basics_compare_value_and_per_fast_mode
+----------------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 28 Jul 2014 21:00:00 UTC +00:00], ["end_time", Sat, 02 Aug 2014 13:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_daily_tests
+-------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 28 Jul 2014 21:00:00 UTC +00:00], ["end_time", Fri, 08 Aug 2014 00:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Tue, 29 Jul 2014 15:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 16:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_per_hour
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Mon, 28 Jul 2014 21:00:00 UTC +00:00], ["end_time", Sat, 02 Aug 2014 13:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_create_banner
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#create as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner", "end_time"=>"2014-08-08 00:00:00 UTC", "frequency"=>"0", "name"=>"Pepsi", "placement_id"=>"405688915", "start_time"=>"2014-07-29 00:00:00 UTC", "target_view_count"=>"1000"}}
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m INSERT INTO "advert_selector_banners" ("comment", "created_at", "end_time", "frequency", "name", "placement_id", "start_time", "target_view_count", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["comment", "Pepsi banner"], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["end_time", Fri, 08 Aug 2014 00:00:00 UTC +00:00], ["frequency", 0], ["name", "Pepsi"], ["placement_id", 405688915], ["start_time", Tue, 29 Jul 2014 00:00:00 UTC +00:00], ["target_view_count", 1000], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558299]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners/814558299
+Completed 302 Found in 8ms (ActiveRecord: 0.5ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_destroy_banner
+-----------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners"[0m
+Processing by AdvertSelector::BannersController#destroy as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 435138789]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 435138789]]
+ [1m[36mAdvertSelector::HelperItem Load (0.0ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656439]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656439]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 394627963 AND position > 2)[0m
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/advert_selector/banners
+Completed 302 Found in 4ms (ActiveRecord: 0.8ms)
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_edit
+-----------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#edit as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+ [1m[35m (0.2ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? [["banner_id", 394627963]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 394627963]]
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (52.4ms)
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.091657') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 100ms (Views: 98.5ms | ActiveRecord: 1.1ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_index
+------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#index as HTML
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.006464') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 11ms (Views: 9.6ms | ActiveRecord: 0.9ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_new
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#new as HTML
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (18.5ms)
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.022142') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 26ms (Views: 24.9ms | ActiveRecord: 0.8ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+--------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_show_banner
+--------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#show as HTML
+ Parameters: {"id"=>"394627963"}
+Redirected to http://test.host/advert_selector/banners/394627963/edit
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner
+----------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#update as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner"}, "id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 3ms (ActiveRecord: 0.3ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner_running_view_count
+-----------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["running_view_count", 1], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Processing by AdvertSelector::BannersController#update_running_view_count as HTML
+ Parameters: {"banner"=>{"running_view_count"=>"99"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mSQL (0.4ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 1061ms (ActiveRecord: 0.7ms)
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.3ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_forbidden_with_default_access
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+Filter chain halted as :admin_access_only rendered or redirected
+Completed 403 Forbidden in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_clear_errors_log
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::MainController#clear_errors_log as HTML
+Redirected to http://test.host/advert_selector/
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_get_index
+---------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.003798') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 8ms (Views: 6.9ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+-----------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_array=
+-----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085[0m [["conflicting_placements_array", "not_found,video"], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'not_found' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'video' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_string_handling
+--------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_with
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------
+AdvertSelector::PlacementTest: test_name_sym
+--------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_create_placement
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+Processing by AdvertSelector::PlacementsController#create as HTML
+ Parameters: {"placement"=>{"name"=>"new placement"}}
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_placements" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["name", "new placement"], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements/1019730478
+Completed 302 Found in 3ms (ActiveRecord: 0.5ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_destroy_placement
+-----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.2ms)[0m SELECT COUNT(*) FROM "advert_selector_placements"
+Processing by AdvertSelector::PlacementsController#destroy as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", "405688915"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mDELETE FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ?[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements
+Completed 302 Found in 3ms (ActiveRecord: 0.4ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_edit
+--------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#edit as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (8.0ms)
+ [1m[36mAdvertSelector::Banner Load (0.4ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.019422') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 20ms (Views: 18.3ms | ActiveRecord: 1.3ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_index
+---------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.4ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.005468') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 12ms (Views: 11.0ms | ActiveRecord: 1.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_new
+-------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = '') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (3.7ms)
+ [1m[36mAdvertSelector::Banner Load (0.5ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.008450') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 14ms (Views: 12.3ms | ActiveRecord: 1.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_show_placement
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#show as HTML
+ Parameters: {"id"=>"405688915"}
+Redirected to http://test.host/advert_selector/placements/405688915/edit
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_update_placement
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#update as HTML
+ Parameters: {"placement"=>{"name"=>"Leaderboard"}, "id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements/405688915
+Completed 302 Found in 5ms (ActiveRecord: 0.6ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------
+AdvertSelectorTest: test_truth
+------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+---------------------------------------
+BannerShowsTest: test_HelperItem_runned
+---------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.6ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.6ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.020666' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.020962' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 28ms (Views: 27.1ms | ActiveRecord: 0.9ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 1)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["name", "always_false"], ["position", 1], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.052440' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.052594' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.4ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 8ms (Views: 6.4ms | ActiveRecord: 0.9ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------------------
+BannerShowsTest: test_HelperItem_with_raising_error_and_common_error_displays
+-----------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 1)[0m
+ [1m[35mSQL (0.2ms)[0m INSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?) [["banner_id", 814558298], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["name", "raise_error"], ["position", 1], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.3ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.010959' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.011140' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Error with banner Coke in placement Leaderboard.
+2014-07-29T12:00:00+03:00 - http://www.example.com/ - {"controller"=>"examples", "action"=>"index"}
+#<ZeroDivisionError: divided by 0>
+
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `/'
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `advert_selector_raise_error'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:53:in `block in advert_selector_banner_try'
+/home/ohu/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.8/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.8/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:49:in `advert_selector_banner_try'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:20:in `block (2 levels) in advert_selector_initialize'
+/home/ohu/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.8/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.8/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:18:in `block in advert_selector_initialize'
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.6ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/advert_selector/placements" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.023951') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mCACHE (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mCACHE (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 14ms (Views: 12.6ms | ActiveRecord: 0.7ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------
+BannerShowsTest: test_banner_frequency,_limit_frequency_within_one_week
+-----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "frequency" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["frequency", 2], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.009116' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.009286' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-08-01 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-08-01 09:00:00.017883' OR end_time IS NULL) AND (start_time < '2014-08-01 10:00:00.018023' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-08-01 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------------------------------
+BannerShowsTest: test_banner_preview_url_forces_banner_and_displays_information
+-------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.007688' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.007836' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 207249520]]
+Started GET "/?advert_selector_force=207249520&advert_selector_force_stamp=1406592000" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+ Parameters: {"advert_selector_force"=>"207249520", "advert_selector_force_stamp"=>"1406592000"}
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = 207249520 LIMIT 1
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 207249520]]
+[AdvertSelector] ForceShowing banner parade_banner in placement Parade
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.018501' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.018695' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 7ms (Views: 5.8ms | ActiveRecord: 0.8ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------------------------------------------
+BannerShowsTest: test_complex_setup_conflicting_banners_placements
+------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520[0m [["confirmed", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.009144' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.009286' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+---------------------------------------------------------------
+BannerShowsTest: test_complex_setup_multiple_banners_placements
+---------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520[0m [["confirmed", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085 [["conflicting_placements_array", ""], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915 [["conflicting_placements_array", ""], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'video') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 1019730477[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.014389' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.014531' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.7ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------
+BannerShowsTest: test_normal_request_and_banner_loading
+-------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.006175' OR end_time IS NULL) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:15:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------
+BannerShowsTest: test_only_once_per_session_banners
+---------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "only_once_per_session" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["only_once_per_session", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.011147' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.011296' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 12ms (Views: 11.5ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+ExamplesControllerTest: test_render_video_once_per_session
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.002246' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.002423' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.6ms)[0m [1mbegin transaction[0m
+ [1m[35mFixture Delete (0.3ms)[0m DELETE FROM "advert_selector_placements"
+ [1m[36mFixture Insert (0.2ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Parade', 'leaderboard,video', '2014-07-29 09:34:31', '2014-07-29 09:34:31', 718799085)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Leaderboard', 'parade', '2014-07-29 09:34:31', '2014-07-29 09:34:31', 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "only_once_per_session", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Video', 't', 'parade', '2014-07-29 09:34:31', '2014-07-29 09:34:31', 1019730477)[0m
+ [1m[35mFixture Delete (0.2ms)[0m DELETE FROM "advert_selector_banners"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "running_view_count", "frequency", "fast_mode", "comment", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Coke', '2014-07-24 00:00:00.000000', '2014-08-03 00:00:00.000000', 1000, 100, 0, 'f', 'Coke banner', 't', 50, '2014-07-29 09:34:31', '2014-07-29 09:34:31', 814558298, 405688915)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "comment", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Pepsi', '2014-07-29 00:00:00.000000', '2014-08-08 00:00:00.000000', 1000, 0, 'Pepsi banner', 't', 't', 100, '2014-07-29 09:34:31', '2014-07-29 09:34:31', 394627963, 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('parade_banner', '2014-07-29 00:00:00.000000', '2014-08-08 00:00:00.000000', 1000, 1, 't', 'f', 1000, '2014-07-29 09:34:31', '2014-07-29 09:34:31', 207249520, 718799085)[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_helper_items"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "position", "created_at", "updated_at", "id", "banner_id") VALUES ('banner_leaderboard', 't', '<img src=''coke_banner''/>', 1, '2014-07-29 09:34:31', '2014-07-29 09:34:31', 929640376, 814558298)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES ('request_params_include?', 'f', 'pepsi=true', '2014-07-29 09:34:31', '2014-07-29 09:34:31', 435138789, 394627963)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (2, 'banner_leaderboard', 't', '<img src=''pepsi_banner''/>', '2014-07-29 09:34:31', '2014-07-29 09:34:31', 960656439, 394627963)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (1, 'banner_parade', 't', '<img src=''banner_parade''/>', '2014-07-29 09:34:31', '2014-07-29 09:34:31', 281932184, 207249520)
+ [1m[36m (45.9ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+--------------------------------------------
+AdvertSelector::BannerTest: test_HelperItems
+--------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE (advert_selector_helper_items.position IS NOT NULL) AND ("advert_selector_helper_items"."banner_id" = 814558298) ORDER BY advert_selector_helper_items.position DESC LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "position", "updated_at") VALUES (?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["position", 2], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 10)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content_for", true], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["name", "content_for_invalid"], ["position", 10], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 1)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["name", "some_limit_helper_here"], ["position", 1], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656440]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656440]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position > 3)[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------------------
+AdvertSelector::BannerTest: test_find_future_&&_find_current_scopes
+-------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.000116' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.000984' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.001155' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-07-29 09:00:00.002072' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-07-29 09:00:00.002703' OR end_time IS NULL) AND (start_time < '2013-07-29 10:00:00.002817' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------
+AdvertSelector::BannerTest: test_name_sym
+-----------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 551], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+--------------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount_reaching_target
+--------------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "target_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["target_view_count", 10], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 10], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_for_default_banners
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_time_usages
+------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 29 Jul 2014 10:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 29 Jul 2014 07:00:00 UTC +00:00], ["end_time", Tue, 29 Jul 2014 08:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", nil], ["end_time", Tue, 29 Jul 2014 10:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_basics_compare_value_and_per_fast_mode
+----------------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 28 Jul 2014 21:00:00 UTC +00:00], ["end_time", Sat, 02 Aug 2014 13:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_daily_tests
+-------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 28 Jul 2014 21:00:00 UTC +00:00], ["end_time", Fri, 08 Aug 2014 00:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Tue, 29 Jul 2014 15:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 16:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_per_hour
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Mon, 28 Jul 2014 21:00:00 UTC +00:00], ["end_time", Sat, 02 Aug 2014 13:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_create_banner
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#create as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner", "end_time"=>"2014-08-08 00:00:00 UTC", "frequency"=>"0", "name"=>"Pepsi", "placement_id"=>"405688915", "start_time"=>"2014-07-29 00:00:00 UTC", "target_view_count"=>"1000"}}
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m INSERT INTO "advert_selector_banners" ("comment", "created_at", "end_time", "frequency", "name", "placement_id", "start_time", "target_view_count", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["comment", "Pepsi banner"], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["end_time", Fri, 08 Aug 2014 00:00:00 UTC +00:00], ["frequency", 0], ["name", "Pepsi"], ["placement_id", 405688915], ["start_time", Tue, 29 Jul 2014 00:00:00 UTC +00:00], ["target_view_count", 1000], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558299]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners/814558299
+Completed 302 Found in 9ms (ActiveRecord: 0.6ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_destroy_banner
+-----------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners"[0m
+Processing by AdvertSelector::BannersController#destroy as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 435138789]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 435138789]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656439]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656439]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 394627963 AND position > 2)[0m
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/advert_selector/banners
+Completed 302 Found in 5ms (ActiveRecord: 0.8ms)
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_edit
+-----------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#edit as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+ [1m[35m (0.2ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? [["banner_id", 394627963]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 394627963]]
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (55.6ms)
+ [1m[35mAdvertSelector::Banner Load (0.3ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.074843') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 83ms (Views: 81.1ms | ActiveRecord: 1.3ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_index
+------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#index as HTML
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners"
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.009090') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.3ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 19ms (Views: 17.5ms | ActiveRecord: 1.1ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_new
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#new as HTML
+ [1m[36mAdvertSelector::Placement Load (0.3ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (30.7ms)
+ [1m[35mAdvertSelector::Banner Load (0.3ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.035775') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 42ms (Views: 39.7ms | ActiveRecord: 1.1ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+--------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_show_banner
+--------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#show as HTML
+ Parameters: {"id"=>"394627963"}
+Redirected to http://test.host/advert_selector/banners/394627963/edit
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner
+----------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#update as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner"}, "id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 4ms (ActiveRecord: 0.5ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.2ms)[0m begin transaction
+-----------------------------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner_running_view_count
+-----------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.4ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["running_view_count", 1], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Processing by AdvertSelector::BannersController#update_running_view_count as HTML
+ Parameters: {"banner"=>{"running_view_count"=>"99"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mSQL (0.5ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 1322ms (ActiveRecord: 0.9ms)
+ [1m[36mAdvertSelector::Banner Load (1.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.2ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_forbidden_with_default_access
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+Filter chain halted as :admin_access_only rendered or redirected
+Completed 403 Forbidden in 3ms (Views: 1.8ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.2ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_clear_errors_log
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::MainController#clear_errors_log as HTML
+Redirected to http://test.host/advert_selector/
+Completed 302 Found in 2ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_get_index
+---------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.005562') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 12ms (Views: 10.3ms | ActiveRecord: 0.9ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.2ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.5ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.2ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.2ms)[0m begin transaction
+-----------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_array=
+-----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085[0m [["conflicting_placements_array", "not_found,video"], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'not_found' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'video' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.8ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_string_handling
+--------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_with
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------
+AdvertSelector::PlacementTest: test_name_sym
+--------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_create_placement
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+Processing by AdvertSelector::PlacementsController#create as HTML
+ Parameters: {"placement"=>{"name"=>"new placement"}}
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_placements" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["name", "new placement"], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements/1019730478
+Completed 302 Found in 3ms (ActiveRecord: 0.4ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_destroy_placement
+-----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_placements"
+Processing by AdvertSelector::PlacementsController#destroy as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", "405688915"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mDELETE FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ?[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements
+Completed 302 Found in 3ms (ActiveRecord: 0.4ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_edit
+--------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#edit as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (16.9ms)
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.024940') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 30ms (Views: 28.2ms | ActiveRecord: 1.2ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_index
+---------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.008695') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 13ms (Views: 11.6ms | ActiveRecord: 1.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_new
+-------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = '') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (4.7ms)
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.009029') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 14ms (Views: 12.6ms | ActiveRecord: 1.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_show_placement
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#show as HTML
+ Parameters: {"id"=>"405688915"}
+Redirected to http://test.host/advert_selector/placements/405688915/edit
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_update_placement
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#update as HTML
+ Parameters: {"placement"=>{"name"=>"Leaderboard"}, "id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements/405688915
+Completed 302 Found in 2ms (ActiveRecord: 0.2ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+------------------------------
+AdvertSelectorTest: test_truth
+------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+---------------------------------------
+BannerShowsTest: test_HelperItem_runned
+---------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.4ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.017222' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.017444' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.3ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (5.9ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 29ms (Views: 22.0ms | ActiveRecord: 6.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.3ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 1)
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["name", "always_false"], ["position", 1], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.051494' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.051722' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.3ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 7ms (Views: 6.1ms | ActiveRecord: 0.8ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.2ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+-----------------------------------------------------------------------------
+BannerShowsTest: test_HelperItem_with_raising_error_and_common_error_displays
+-----------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 1)[0m
+ [1m[35mSQL (0.3ms)[0m INSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?) [["banner_id", 814558298], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["name", "raise_error"], ["position", 1], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.3ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.014812' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.015039' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.3ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Error with banner Coke in placement Leaderboard.
+2014-07-29T12:00:00+03:00 - http://www.example.com/ - {"controller"=>"examples", "action"=>"index"}
+#<ZeroDivisionError: divided by 0>
+
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `/'
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `advert_selector_raise_error'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:53:in `block in advert_selector_banner_try'
+/home/ohu/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.8/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.8/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:49:in `advert_selector_banner_try'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:20:in `block (2 levels) in advert_selector_initialize'
+/home/ohu/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.8/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.8/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:18:in `block in advert_selector_initialize'
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 8ms (Views: 7.2ms | ActiveRecord: 0.8ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/advert_selector/placements" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.4ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.034850') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mCACHE (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mCACHE (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 18ms (Views: 16.6ms | ActiveRecord: 0.8ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------
+BannerShowsTest: test_banner_frequency,_limit_frequency_within_one_week
+-----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "frequency" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["frequency", 2], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.010106' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.010361' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-08-01 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-08-01 09:00:00.020676' OR end_time IS NULL) AND (start_time < '2014-08-01 10:00:00.020850' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-08-01 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------------------------------
+BannerShowsTest: test_banner_preview_url_forces_banner_and_displays_information
+-------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.006633' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.006761' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 207249520]]
+Started GET "/?advert_selector_force=207249520&advert_selector_force_stamp=1406592000" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+ Parameters: {"advert_selector_force"=>"207249520", "advert_selector_force_stamp"=>"1406592000"}
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = 207249520 LIMIT 1
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 207249520]]
+[AdvertSelector] ForceShowing banner parade_banner in placement Parade
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.016489' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.016653' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.8ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+------------------------------------------------------------------
+BannerShowsTest: test_complex_setup_conflicting_banners_placements
+------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520[0m [["confirmed", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.009218' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.009350' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.0ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+---------------------------------------------------------------
+BannerShowsTest: test_complex_setup_multiple_banners_placements
+---------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520[0m [["confirmed", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085 [["conflicting_placements_array", ""], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915 [["conflicting_placements_array", ""], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'video') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 1019730477[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.014553' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.014710' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 7ms (Views: 6.4ms | ActiveRecord: 0.6ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------
+BannerShowsTest: test_normal_request_and_banner_loading
+-------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.006628' OR end_time IS NULL) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 2.1ms | ActiveRecord: 0.0ms)
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:15:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------
+BannerShowsTest: test_only_once_per_session_banners
+---------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "only_once_per_session" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["only_once_per_session", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.013540' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.013830' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 12ms (Views: 11.7ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+ExamplesControllerTest: test_render_video_once_per_session
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.001904' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.002089' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.4ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.3ms)[0m [1mbegin transaction[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_placements"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Parade', 'leaderboard,video', '2014-07-29 10:21:58', '2014-07-29 10:21:58', 718799085)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_placements" ("name", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Leaderboard', 'parade', '2014-07-29 10:21:58', '2014-07-29 10:21:58', 405688915)
+ [1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "advert_selector_placements" ("name", "only_once_per_session", "conflicting_placements_array", "created_at", "updated_at", "id") VALUES ('Video', 't', 'parade', '2014-07-29 10:21:58', '2014-07-29 10:21:58', 1019730477)[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_banners"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "running_view_count", "frequency", "fast_mode", "comment", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Coke', '2014-07-24 00:00:00.000000', '2014-08-03 00:00:00.000000', 1000, 100, 0, 'f', 'Coke banner', 't', 50, '2014-07-29 10:21:58', '2014-07-29 10:21:58', 814558298, 405688915)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "comment", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('Pepsi', '2014-07-29 00:00:00.000000', '2014-08-08 00:00:00.000000', 1000, 0, 'Pepsi banner', 't', 't', 100, '2014-07-29 10:21:58', '2014-07-29 10:21:58', 394627963, 405688915)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_banners" ("name", "start_time", "end_time", "target_view_count", "frequency", "fast_mode", "confirmed", "priority", "created_at", "updated_at", "id", "placement_id") VALUES ('parade_banner', '2014-07-29 00:00:00.000000', '2014-08-08 00:00:00.000000', 1000, 1, 't', 'f', 1000, '2014-07-29 10:21:58', '2014-07-29 10:21:58', 207249520, 718799085)[0m
+ [1m[35mFixture Delete (0.1ms)[0m DELETE FROM "advert_selector_helper_items"
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "position", "created_at", "updated_at", "id", "banner_id") VALUES ('banner_leaderboard', 't', '<img src=''coke_banner''/>', 1, '2014-07-29 10:21:58', '2014-07-29 10:21:58', 929640376, 814558298)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES ('request_params_include?', 'f', 'pepsi=true', '2014-07-29 10:21:58', '2014-07-29 10:21:58', 435138789, 394627963)
+ [1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (2, 'banner_leaderboard', 't', '<img src=''pepsi_banner''/>', '2014-07-29 10:21:58', '2014-07-29 10:21:58', 960656439, 394627963)[0m
+ [1m[35mFixture Insert (0.1ms)[0m INSERT INTO "advert_selector_helper_items" ("position", "name", "content_for", "content", "created_at", "updated_at", "id", "banner_id") VALUES (1, 'banner_parade', 't', '<img src=''banner_parade''/>', '2014-07-29 10:21:58', '2014-07-29 10:21:58', 281932184, 207249520)
+ [1m[36m (38.9ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.2ms)[0m begin transaction
+--------------------------------------------
+AdvertSelector::BannerTest: test_HelperItems
+--------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.6ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE (advert_selector_helper_items.position IS NOT NULL) AND ("advert_selector_helper_items"."banner_id" = 814558298) ORDER BY advert_selector_helper_items.position DESC LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "position", "updated_at") VALUES (?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["position", 2], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 10)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "content_for", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["content_for", true], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["name", "content_for_invalid"], ["position", 10], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 1)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["name", "some_limit_helper_here"], ["position", 1], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656440]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656440]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position > 3)[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items"
+ [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------------------
+AdvertSelector::BannerTest: test_find_future_&&_find_current_scopes
+-------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.000102' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.000848' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.000992' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-07-29 09:00:00.001792' OR end_time IS NULL)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners" WHERE (end_time > '2013-07-29 09:00:00.002400' OR end_time IS NULL) AND (start_time < '2013-07-29 10:00:00.002501' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count)[0m
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------
+AdvertSelector::BannerTest: test_name_sym
+-----------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 551], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+--------------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_running_viewcount_&_add_one_viewcount_reaching_target
+--------------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "target_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["target_view_count", 10], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 10], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_for_default_banners
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["confirmed", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.2ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------------------------------------
+AdvertSelector::BannerTest: test_show_now_basic?_time_usages
+------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 29 Jul 2014 10:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Tue, 29 Jul 2014 07:00:00 UTC +00:00], ["end_time", Tue, 29 Jul 2014 08:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", nil], ["end_time", Tue, 29 Jul 2014 10:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_basics_compare_value_and_per_fast_mode
+----------------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 28 Jul 2014 21:00:00 UTC +00:00], ["end_time", Sat, 02 Aug 2014 13:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_daily_tests
+-------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Mon, 28 Jul 2014 21:00:00 UTC +00:00], ["end_time", Fri, 08 Aug 2014 00:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["running_view_count", 0], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "start_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["start_time", Tue, 29 Jul 2014 15:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 16:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.2ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::BannerTest: test_view_count_per_hour
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "start_time" = ?, "end_time" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["start_time", Mon, 28 Jul 2014 21:00:00 UTC +00:00], ["end_time", Sat, 02 Aug 2014 13:00:00 UTC +00:00], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["running_view_count", 0], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_create_banner
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+Processing by AdvertSelector::BannersController#create as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner", "end_time"=>"2014-08-08 00:00:00 UTC", "frequency"=>"0", "name"=>"Pepsi", "placement_id"=>"405688915", "start_time"=>"2014-07-29 00:00:00 UTC", "target_view_count"=>"1000"}}
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.5ms)[0m INSERT INTO "advert_selector_banners" ("comment", "created_at", "end_time", "frequency", "name", "placement_id", "start_time", "target_view_count", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["comment", "Pepsi banner"], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["end_time", Fri, 08 Aug 2014 00:00:00 UTC +00:00], ["frequency", 0], ["name", "Pepsi"], ["placement_id", 405688915], ["start_time", Tue, 29 Jul 2014 00:00:00 UTC +00:00], ["target_view_count", 1000], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558299]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners/814558299
+Completed 302 Found in 8ms (ActiveRecord: 0.7ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_destroy_banner
+-----------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_banners"[0m
+Processing by AdvertSelector::BannersController#destroy as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 435138789]]
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 435138789]]
+ [1m[36mAdvertSelector::HelperItem Load (0.0ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? LIMIT 1[0m [["id", 960656439]]
+ [1m[35mSQL (0.0ms)[0m DELETE FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."id" = ? [["id", 960656439]]
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position - 1) WHERE ("advert_selector_helper_items"."banner_id" = 394627963 AND position > 2)[0m
+ [1m[35mSQL (0.1ms)[0m DELETE FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/advert_selector/banners
+Completed 302 Found in 4ms (ActiveRecord: 0.7ms)
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_banners"
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_edit
+-----------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#edit as HTML
+ Parameters: {"id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+ [1m[35m (0.2ms)[0m SELECT COUNT(*) FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? [["banner_id", 394627963]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 394627963]]
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (48.6ms)
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.063810') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 69ms (Views: 66.8ms | ActiveRecord: 1.2ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_index
+------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#index as HTML
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.006464') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 10ms (Views: 9.0ms | ActiveRecord: 0.7ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_get_new
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#new as HTML
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/banners/_form.html.erb (17.5ms)
+ [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.021049') ORDER BY priority desc LIMIT 10
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+Completed 200 OK in 24ms (Views: 23.3ms | ActiveRecord: 0.7ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+--------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_show_banner
+--------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::BannersController#show as HTML
+ Parameters: {"id"=>"394627963"}
+Redirected to http://test.host/advert_selector/banners/394627963/edit
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner
+----------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::BannersController#update as HTML
+ Parameters: {"banner"=>{"comment"=>"Pepsi banner"}, "id"=>"394627963"}
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", "394627963"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 3ms (ActiveRecord: 0.3ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------------------------
+AdvertSelector::BannersControllerTest: test_should_update_banner_running_view_count
+-----------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["running_view_count", 1], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Processing by AdvertSelector::BannersController#update_running_view_count as HTML
+ Parameters: {"banner"=>{"running_view_count"=>"99"}, "id"=>"394627963"}
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", "394627963"]]
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963[0m
+ [1m[35mSQL (0.6ms)[0m UPDATE "advert_selector_banners" SET "running_view_count" = 99 WHERE "advert_selector_banners"."id" = 394627963
+Redirected to http://test.host/advert_selector/banners/394627963
+Completed 302 Found in 1072ms (ActiveRecord: 0.9ms)
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_forbidden_with_default_access
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+Filter chain halted as :admin_access_only rendered or redirected
+Completed 403 Forbidden in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_clear_errors_log
+----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+Processing by AdvertSelector::MainController#clear_errors_log as HTML
+Redirected to http://test.host/advert_selector/
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------
+AdvertSelector::MainControllerTest: test_should_get_index
+---------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by AdvertSelector::MainController#index as HTML
+ [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.003787') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 8ms (Views: 7.1ms | ActiveRecord: 0.7ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_array=
+-----------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085[0m [["conflicting_placements_array", "not_found,video"], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'not_found' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."name" = 'video' ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_placements_string_handling
+--------------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+----------------------------------------------------
+AdvertSelector::PlacementTest: test_conflicting_with
+----------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------
+AdvertSelector::PlacementTest: test_name_sym
+--------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_create_placement
+----------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+Processing by AdvertSelector::PlacementsController#create as HTML
+ Parameters: {"placement"=>{"name"=>"new placement"}}
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "advert_selector_placements" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["name", "new placement"], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements/1019730478
+Completed 302 Found in 3ms (ActiveRecord: 0.4ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_destroy_placement
+-----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "advert_selector_placements"
+Processing by AdvertSelector::PlacementsController#destroy as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", "405688915"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mDELETE FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ?[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements
+Completed 302 Found in 2ms (ActiveRecord: 0.4ms)
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "advert_selector_placements"[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_edit
+--------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#edit as HTML
+ Parameters: {"id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36mAdvertSelector::Placement Load (0.2ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (6.7ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.012172') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (3.9ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 20ms (Views: 14.5ms | ActiveRecord: 4.8ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_index
+---------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.005720') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 9ms (Views: 7.8ms | ActiveRecord: 0.6ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_get_new
+-------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#new as HTML
+ [1m[35mAdvertSelector::Placement Load (0.2ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = '') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ Rendered /home/ohu/koodi/own_gems_programs/advert_selector/app/views/advert_selector/placements/_form.html.erb (3.9ms)
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.007561') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 11ms (Views: 10.1ms | ActiveRecord: 0.8ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+--------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_show_placement
+--------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#show as HTML
+ Parameters: {"id"=>"405688915"}
+Redirected to http://test.host/advert_selector/placements/405688915/edit
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------------------
+AdvertSelector::PlacementsControllerTest: test_should_update_placement
+----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+Processing by AdvertSelector::PlacementsController#update as HTML
+ Parameters: {"placement"=>{"name"=>"Leaderboard"}, "id"=>"405688915"}
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", "405688915"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/advert_selector/placements/405688915
+Completed 302 Found in 2ms (ActiveRecord: 0.2ms)
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------
+AdvertSelectorTest: test_truth
+------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35m (0.0ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------
+BannerShowsTest: test_HelperItem_runned
+---------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.013449' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.013663' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 14ms (Views: 13.2ms | ActiveRecord: 0.5ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 1)
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["banner_id", 814558298], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["name", "always_false"], ["position", 1], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.030650' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.030791' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.4ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-----------------------------------------------------------------------------
+BannerShowsTest: test_HelperItem_with_raising_error_and_common_error_displays
+-----------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_helper_items" SET position = (position + 1) WHERE ("advert_selector_helper_items"."banner_id" = 814558298 AND position >= 1)[0m
+ [1m[35mSQL (0.2ms)[0m INSERT INTO "advert_selector_helper_items" ("banner_id", "created_at", "name", "position", "updated_at") VALUES (?, ?, ?, ?, ?) [["banner_id", 814558298], ["created_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00], ["name", "raise_error"], ["position", 1], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.009511' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.009624' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Error with banner Coke in placement Leaderboard.
+2014-07-29T12:00:00+03:00 - http://www.example.com/ - {"controller"=>"examples", "action"=>"index"}
+#<ZeroDivisionError: divided by 0>
+
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `/'
+/home/ohu/koodi/own_gems_programs/advert_selector/test/dummy/app/helpers/advert_selector_helper.rb:9:in `advert_selector_raise_error'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:53:in `block in advert_selector_banner_try'
+/home/ohu/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.8/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.8/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:49:in `advert_selector_banner_try'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:20:in `block (2 levels) in advert_selector_initialize'
+/home/ohu/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.8/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.8/lib/active_record/relation/delegation.rb:13:in `each'
+/home/ohu/koodi/own_gems_programs/advert_selector/app/helpers/advert_selector/application_helper.rb:18:in `block in advert_selector_initialize'
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/advert_selector/placements" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by AdvertSelector::PlacementsController#index as HTML
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements"
+ [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time is null or end_time > '2014-07-27 09:00:00.020679') ORDER BY priority desc LIMIT 10[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35mCACHE (0.0ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 405688915]]
+ [1m[36mCACHE (0.0ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements"[0m
+Completed 200 OK in 11ms (Views: 10.2ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+-----------------------------------------------------------------------
+BannerShowsTest: test_banner_frequency,_limit_frequency_within_one_week
+-----------------------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "frequency" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["frequency", 2], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.007983' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.008138' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-08-01 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-08-01 09:00:00.015867' OR end_time IS NULL) AND (start_time < '2014-08-01 10:00:00.015991' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.2ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-08-01 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------------------------------
+BannerShowsTest: test_banner_preview_url_forces_banner_and_displays_information
+-------------------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.007650' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.007791' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 207249520]]
+Started GET "/?advert_selector_force=207249520&advert_selector_force_stamp=1406592000" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+ Parameters: {"advert_selector_force"=>"207249520", "advert_selector_force_stamp"=>"1406592000"}
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = 207249520 LIMIT 1
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 718799085]]
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 207249520]]
+[AdvertSelector] ForceShowing banner parade_banner in placement Parade
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.017271' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.017403' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC[0m
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 4.8ms | ActiveRecord: 0.7ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+------------------------------------------------------------------
+BannerShowsTest: test_complex_setup_conflicting_banners_placements
+------------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520[0m [["confirmed", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 207249520]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.009406' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.009548' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 2.2ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+---------------------------------------------------------------
+BannerShowsTest: test_complex_setup_multiple_banners_placements
+---------------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 207249520[0m [["confirmed", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 207249520]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1 [["id", 718799085]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 718799085 [["conflicting_placements_array", ""], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'leaderboard') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915 [["conflicting_placements_array", ""], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1[0m
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'video') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "advert_selector_placements" SET "conflicting_placements_array" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 1019730477[0m [["conflicting_placements_array", ""], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE (LOWER(name) = 'parade') ORDER BY "advert_selector_placements"."id" ASC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.014292' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.014465' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (207249520) parade_banner in placement Parade
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 11ms (Views: 10.2ms | ActiveRecord: 0.5ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 207249520]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+-------------------------------------------------------
+BannerShowsTest: test_normal_request_and_banner_loading
+-------------------------------------------------------
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 207249520]]
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298 [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963[0m [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 394627963]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[35mAdvertSelector::Banner Load (0.2ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.005687' OR end_time IS NULL) ORDER BY priority desc
+[AdvertSelector] [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)[0m
+[AdvertSelector] [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.4ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:15:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+---------------------------------------------------
+BannerShowsTest: test_only_once_per_session_banners
+---------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+ [1m[36mAdvertSelector::Banner Load (0.0ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 814558298]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_banners" SET "fast_mode" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 814558298[0m [["fast_mode", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC [["banner_id", 814558298]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 394627963]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.1ms)[0m UPDATE "advert_selector_banners" SET "confirmed" = ?, "updated_at" = ? WHERE "advert_selector_banners"."id" = 394627963 [["confirmed", false], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? ORDER BY "advert_selector_helper_items"."position" ASC[0m [["banner_id", 394627963]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAdvertSelector::Placement Load (0.1ms)[0m [1mSELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" = ? LIMIT 1[0m [["id", 405688915]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "advert_selector_placements" SET "only_once_per_session" = ?, "updated_at" = ? WHERE "advert_selector_placements"."id" = 405688915[0m [["only_once_per_session", true], ["updated_at", Tue, 29 Jul 2014 09:00:00 UTC +00:00]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.3ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.008583' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.008716' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 12ms (Views: 10.8ms | ActiveRecord: 0.6ms)
+ [1m[35mAdvertSelector::HelperItem Load (0.1ms)[0m SELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1 [["banner_id", 814558298]]
+Started GET "/" for 127.0.0.1 at 2014-07-29 12:00:00 +0300
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)
+ [1m[36mAdvertSelector::HelperItem Load (0.1ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" = ? AND "advert_selector_helper_items"."content_for" = 't' ORDER BY "advert_selector_helper_items"."position" DESC LIMIT 1[0m [["banner_id", 814558298]]
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+----------------------------------------------------------
+ExamplesControllerTest: test_render_video_once_per_session
+----------------------------------------------------------
+ [1m[35mAdvertSelector::Banner Load (0.1ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 814558298]]
+ [1m[36mAdvertSelector::Banner Load (0.1ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1[0m [["id", 394627963]]
+ [1m[35mAdvertSelector::Banner Load (0.0ms)[0m SELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE "advert_selector_banners"."id" = ? LIMIT 1 [["id", 207249520]]
+Processing by ExamplesController#index as HTML
+[AdvertSelector] AdvertSelection initialized
+[AdvertSelector] AdvertSelection fetching banners and placements
+[AdvertSelector] [1m[36mAdvertSelector::Banner Load (0.2ms)[0m [1mSELECT "advert_selector_banners".* FROM "advert_selector_banners" WHERE (end_time > '2014-07-29 09:00:00.002196' OR end_time IS NULL) AND (start_time < '2014-07-29 10:00:00.002380' OR start_time IS NULL) AND (target_view_count IS NULL OR target_view_count > running_view_count) ORDER BY priority desc[0m
+[AdvertSelector] [1m[35mAdvertSelector::Placement Load (0.1ms)[0m SELECT "advert_selector_placements".* FROM "advert_selector_placements" WHERE "advert_selector_placements"."id" IN (718799085, 405688915)
+[AdvertSelector] [1m[36mAdvertSelector::HelperItem Load (0.2ms)[0m [1mSELECT "advert_selector_helper_items".* FROM "advert_selector_helper_items" WHERE "advert_selector_helper_items"."banner_id" IN (207249520, 394627963, 814558298) ORDER BY "advert_selector_helper_items"."position" ASC[0m
+[AdvertSelector] Showing banner (814558298) Coke in placement Leaderboard
+[AdvertSelector] AdvertSelection finished
+Completed 200 OK in 6ms (Views: 4.9ms | ActiveRecord: 0.5ms)
+ [1m[35m (0.1ms)[0m rollback transaction