searchable_models 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/searchable_models/searchable.rb +8 -12
- data/lib/searchable_models/version.rb +1 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +366 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d004e320e0f031038e3f7eaf8cde613b0151aa2
|
4
|
+
data.tar.gz: 51672c6455b24c0b2348df3415515b5183331dce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b058f86263d4ab5749752d3d1560489970645f5b089f479fa6fc5ea684b0dd6bcee13c4b33cd39b874db3cbaa742d6edb43905be66c10128cb7a1cc3e944e98
|
7
|
+
data.tar.gz: 67a82eed82171e32881e22f374c7bd997da7f1bbcd2d72518345c66ab5c97c0f28f8782d403f70e5b5612225049cdf738c207deead67034970df58d9588a36bf
|
@@ -3,37 +3,33 @@ module SearchableModels
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
included do
|
6
|
-
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
mattr_accessor :search_order, :instance_accessor => false do
|
11
|
-
:id
|
12
|
-
end
|
6
|
+
class_attribute :_search_fields
|
7
|
+
class_attribute :_search_order
|
13
8
|
|
14
9
|
define_singleton_method(:search) do |params|
|
15
10
|
results = all
|
16
11
|
|
17
|
-
fields =
|
12
|
+
fields = _search_fields.select do |_, v|
|
18
13
|
v.try(:exclude?, :mode) \
|
19
14
|
|| %i(exact scope enum).include?(v.try(:[], :mode))
|
20
15
|
end
|
21
16
|
results = _search(results, fields, params)
|
22
17
|
|
23
|
-
fields =
|
18
|
+
fields = _search_fields.select { |_, v| v.try(:[], :mode) == :fuzzy }
|
24
19
|
results = _fuzzy_search(results, fields, params)
|
25
20
|
|
26
|
-
results.uniq.order(
|
21
|
+
results.uniq.order(_search_order || :id)
|
27
22
|
end
|
28
23
|
end
|
29
24
|
|
30
25
|
module ClassMethods
|
31
26
|
def search_on(*args)
|
32
|
-
self.
|
27
|
+
self._search_fields ||= {}
|
28
|
+
self._search_fields.merge!(args.first => args.extract_options!)
|
33
29
|
end
|
34
30
|
|
35
31
|
def search_ordered_by(field)
|
36
|
-
self.
|
32
|
+
self._search_order = field
|
37
33
|
end
|
38
34
|
|
39
35
|
private
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/test/dummy/log/test.log
CHANGED
@@ -298,6 +298,372 @@ CarTest: test_search_car_with_tags_OR
|
|
298
298
|
[1m[35m (0.1ms)[0m begin transaction
|
299
299
|
-------------------------------------
|
300
300
|
CarTest: test_search_car_with_through
|
301
|
+
-------------------------------------
|
302
|
+
[1m[36mComponent Load (0.2ms)[0m [1mSELECT "components".* FROM "components" WHERE "components"."id" = ? LIMIT 1[0m [["id", 172444051]]
|
303
|
+
[1m[35mCar Load (0.1ms)[0m SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
|
304
|
+
[1m[36mCar Load (0.2ms)[0m [1mSELECT DISTINCT "cars".* FROM "cars" INNER JOIN "doors" ON "doors"."car_id" = "cars"."id" WHERE "doors"."component_id" = 172444051 ORDER BY "cars"."id" ASC[0m
|
305
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
306
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.4ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
307
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
308
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
309
|
+
[1m[35mFixture Delete (0.5ms)[0m DELETE FROM "cars"
|
310
|
+
[1m[36mFixture Insert (0.4ms)[0m [1mINSERT INTO "cars" ("name", "description", "number_of_doors", "brand", "model", "import_date", "kind", "created_at", "updated_at", "id", "group_id") VALUES ('Car One', 'This is Car One', 4, 'Brand One Ultimate', 'Model One', '1990-10-10', 0, '2014-11-14 15:28:37', '2014-11-14 15:28:37', 835429954, 972975755)[0m
|
311
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "cars" ("name", "description", "number_of_doors", "brand", "model", "import_date", "kind", "created_at", "updated_at", "id", "group_id") VALUES ('Car Two', 'This is Car Two', 3, 'Brand Two Ultimate', 'Model Two', '1990-10-15', 1, '2014-11-14 15:28:37', '2014-11-14 15:28:37', 443394774, 972975755)
|
312
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "cars" ("name", "description", "number_of_doors", "brand", "model", "import_date", "kind", "created_at", "updated_at", "id", "group_id") VALUES ('Car Foo foo Bar', 'This is Car Foo foo bar', 2, 'Brand Foo bar', 'Model Foo bar', '1990-10-20', 2, '2014-11-14 15:28:37', '2014-11-14 15:28:37', 131351955, 266440024)[0m
|
313
|
+
[1m[35mFixture Delete (0.5ms)[0m DELETE FROM "components"
|
314
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "components" ("name", "serial", "created_at", "updated_at", "id", "provider_id") VALUES ('Component one', 1234567890987654321, '2014-11-14 15:28:37', '2014-11-14 15:28:37', 1012443712, 665974588)[0m
|
315
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "components" ("name", "serial", "created_at", "updated_at", "id", "provider_id") VALUES ('Component two', 1234567890987654321, '2014-11-14 15:28:37', '2014-11-14 15:28:37', 402564824, 202898348)
|
316
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "components" ("name", "serial", "created_at", "updated_at", "id", "provider_id") VALUES ('Component foo', 1234567890987654321, '2014-11-14 15:28:37', '2014-11-14 15:28:37', 172444051, 296621295)[0m
|
317
|
+
[1m[35mFixture Delete (0.6ms)[0m DELETE FROM "doors"
|
318
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "doors" ("name", "created_at", "updated_at", "id", "car_id", "component_id") VALUES ('Door one', '2014-11-14 15:28:37', '2014-11-14 15:28:37', 546177811, 835429954, 1012443712)[0m
|
319
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "doors" ("name", "created_at", "updated_at", "id", "car_id", "component_id") VALUES ('Door Two', '2014-11-14 15:28:37', '2014-11-14 15:28:37', 187174789, 443394774, 402564824)
|
320
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "doors" ("name", "created_at", "updated_at", "id", "car_id", "component_id") VALUES ('Door Foo', '2014-11-14 15:28:37', '2014-11-14 15:28:37', 378659014, 131351955, 172444051)[0m
|
321
|
+
[1m[35mFixture Delete (0.1ms)[0m DELETE FROM "groups"
|
322
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "groups" ("name", "created_at", "updated_at", "id") VALUES ('Group one', '2014-11-14 15:28:37', '2014-11-14 15:28:37', 972975755)[0m
|
323
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "groups" ("name", "created_at", "updated_at", "id") VALUES ('Group foo', '2014-11-14 15:28:37', '2014-11-14 15:28:37', 266440024)
|
324
|
+
[1m[36mFixture Delete (0.1ms)[0m [1mDELETE FROM "providers"[0m
|
325
|
+
[1m[35mFixture Insert (0.0ms)[0m INSERT INTO "providers" ("name", "created_at", "updated_at", "id") VALUES ('Provider one', '2014-11-14 15:28:37', '2014-11-14 15:28:37', 665974588)
|
326
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "providers" ("name", "created_at", "updated_at", "id") VALUES ('Provider two', '2014-11-14 15:28:37', '2014-11-14 15:28:37', 202898348)[0m
|
327
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "providers" ("name", "created_at", "updated_at", "id") VALUES ('Provider foo', '2014-11-14 15:28:37', '2014-11-14 15:28:37', 296621295)
|
328
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
329
|
+
[1m[35m (0.1ms)[0m begin transaction
|
330
|
+
-------------------------------------------------------
|
331
|
+
SearchableModelsTest: test_module_is_correctly_included
|
332
|
+
-------------------------------------------------------
|
333
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
334
|
+
[1m[35m (0.1ms)[0m begin transaction
|
335
|
+
------------------------------------------
|
336
|
+
CarTest: test_search_car_with_belong_to_id
|
337
|
+
------------------------------------------
|
338
|
+
[1m[36mGroup Load (0.2ms)[0m [1mSELECT "groups".* FROM "groups" WHERE "groups"."id" = ? LIMIT 1[0m [["id", 266440024]]
|
339
|
+
[1m[35mCar Load (0.2ms)[0m SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
|
340
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT DISTINCT "cars".* FROM "cars" WHERE "cars"."group_id" = 266440024 ORDER BY "cars"."id" ASC[0m
|
341
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
342
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
343
|
+
------------------------------------------
|
344
|
+
CarTest: test_search_car_with_deep_through
|
345
|
+
------------------------------------------
|
346
|
+
[1m[35mProvider Load (0.1ms)[0m SELECT "providers".* FROM "providers" WHERE "providers"."id" = ? LIMIT 1 [["id", 296621295]]
|
347
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
348
|
+
[1m[35mCar Load (0.3ms)[0m SELECT DISTINCT "cars".* FROM "cars" INNER JOIN "doors" ON "doors"."car_id" = "cars"."id" INNER JOIN "components" ON "components"."id" = "doors"."component_id" WHERE "components"."provider_id" = 296621295 ORDER BY "cars"."id" ASC
|
349
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
350
|
+
[1m[35m (0.1ms)[0m begin transaction
|
351
|
+
----------------------------------
|
352
|
+
CarTest: test_search_car_with_enum
|
353
|
+
----------------------------------
|
354
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
355
|
+
[1m[35mCar Load (0.1ms)[0m SELECT DISTINCT "cars".* FROM "cars" WHERE "cars"."kind" = 2 ORDER BY "cars"."id" ASC
|
356
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
357
|
+
[1m[35m (0.0ms)[0m begin transaction
|
358
|
+
------------------------------------------
|
359
|
+
CarTest: test_search_car_with_exact_search
|
360
|
+
------------------------------------------
|
361
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
362
|
+
[1m[35mCar Load (0.1ms)[0m SELECT DISTINCT "cars".* FROM "cars" WHERE "cars"."number_of_doors" = 2 ORDER BY "cars"."id" ASC
|
363
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
364
|
+
[1m[35m (0.1ms)[0m begin transaction
|
365
|
+
-------------------------------------------------------------
|
366
|
+
CarTest: test_search_car_with_fuzzy_search_on_multiple_fields
|
367
|
+
-------------------------------------------------------------
|
368
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
369
|
+
[1m[35mCar Load (0.1ms)[0m SELECT DISTINCT "cars".* FROM "cars" WHERE ((LOWER(cars.name) like '%foo%' OR LOWER(cars.description) like '%foo%')) ORDER BY "cars"."id" ASC
|
370
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
371
|
+
[1m[35m (0.0ms)[0m begin transaction
|
372
|
+
-------------------------------------------------------
|
373
|
+
CarTest: test_search_car_with_fuzzy_search_on_one_field
|
374
|
+
-------------------------------------------------------
|
375
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
376
|
+
[1m[35mCar Load (0.1ms)[0m SELECT DISTINCT "cars".* FROM "cars" WHERE ((LOWER(cars.brand) like '%foo%')) ORDER BY "cars"."id" ASC
|
377
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
378
|
+
[1m[35m (0.0ms)[0m begin transaction
|
379
|
+
------------------------------------------------------------------------
|
380
|
+
CarTest: test_search_car_with_fuzzy_search_on_one_field_with_named_param
|
381
|
+
------------------------------------------------------------------------
|
382
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
383
|
+
[1m[35mCar Load (0.1ms)[0m SELECT DISTINCT "cars".* FROM "cars" WHERE ((LOWER(cars.model) like '%foo%')) ORDER BY "cars"."id" ASC
|
384
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
385
|
+
[1m[35m (0.0ms)[0m begin transaction
|
386
|
+
----------------------------------------
|
387
|
+
CarTest: test_search_car_with_i18n_field
|
388
|
+
----------------------------------------
|
389
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
390
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
391
|
+
[1m[36mCar::Translation Load (0.5ms)[0m [1mSELECT "car_translations".* FROM "car_translations" WHERE "car_translations"."car_id" = ?[0m [["car_id", 131351955]]
|
392
|
+
[1m[35mSQL (0.4ms)[0m UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:28:37.533306"]]
|
393
|
+
[1m[36mSQL (0.8ms)[0m [1mINSERT INTO "car_translations" ("car_id", "commercial_name", "created_at", "locale", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["car_id", 131351955], ["commercial_name", "Commercial Name en"], ["created_at", "2014-11-14 15:28:37.541303"], ["locale", "en"], ["updated_at", "2014-11-14 15:28:37.541303"]]
|
394
|
+
[1m[35mCar Load (0.2ms)[0m SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
|
395
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "cars" SET "updated_at" = '2014-11-14 15:28:37.549578' WHERE "cars"."id" = 131351955[0m
|
396
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
397
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
398
|
+
[1m[35mSQL (1.2ms)[0m UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:28:37.553283"]]
|
399
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "car_translations" ("car_id", "commercial_name", "created_at", "locale", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["car_id", 131351955], ["commercial_name", "Commercial Name fr"], ["created_at", "2014-11-14 15:28:37.556286"], ["locale", "fr"], ["updated_at", "2014-11-14 15:28:37.556286"]]
|
400
|
+
[1m[35mCar Load (0.0ms)[0m SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
|
401
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "cars" SET "updated_at" = '2014-11-14 15:28:37.557915' WHERE "cars"."id" = 131351955[0m
|
402
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
403
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
404
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:28:37.559720"]]
|
405
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "car_translations" ("car_id", "commercial_name", "created_at", "locale", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["car_id", 131351955], ["commercial_name", "Commercial Name es"], ["created_at", "2014-11-14 15:28:37.560972"], ["locale", "es"], ["updated_at", "2014-11-14 15:28:37.560972"]]
|
406
|
+
[1m[35mCar Load (0.0ms)[0m SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
|
407
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "cars" SET "updated_at" = '2014-11-14 15:28:37.562236' WHERE "cars"."id" = 131351955[0m
|
408
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
409
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
410
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:28:37.565077"]]
|
411
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "car_translations" ("car_id", "commercial_name", "created_at", "locale", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["car_id", 131351955], ["commercial_name", "Commercial Name pt"], ["created_at", "2014-11-14 15:28:37.567491"], ["locale", "pt"], ["updated_at", "2014-11-14 15:28:37.567491"]]
|
412
|
+
[1m[35mCar Load (0.1ms)[0m SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
|
413
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "cars" SET "updated_at" = '2014-11-14 15:28:37.569955' WHERE "cars"."id" = 131351955[0m
|
414
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
415
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
416
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:28:37.571673"]]
|
417
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "car_translations" SET "commercial_name" = ?, "updated_at" = ? WHERE "car_translations"."id" = 4[0m [["commercial_name", "Commercial Name foobarish! pt"], ["updated_at", "2014-11-14 15:28:37.572735"]]
|
418
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "cars" SET "updated_at" = '2014-11-14 15:28:37.573273' WHERE "cars"."id" = 131351955
|
419
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
420
|
+
[1m[35mCar Load (0.1ms)[0m SELECT DISTINCT "cars".* FROM "cars" INNER JOIN "car_translations" ON "car_translations"."car_id" = "cars"."id" WHERE ((LOWER(car_translations.commercial_name) like '%bar%')) ORDER BY "cars"."id" ASC
|
421
|
+
[1m[36m (0.6ms)[0m [1mrollback transaction[0m
|
422
|
+
[1m[35m (0.1ms)[0m begin transaction
|
423
|
+
-----------------------------------
|
424
|
+
CarTest: test_search_car_with_scope
|
425
|
+
-----------------------------------
|
426
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
427
|
+
[1m[35mCar Load (0.1ms)[0m SELECT DISTINCT "cars".* FROM "cars" WHERE "cars"."import_date" = '1990-10-20' ORDER BY "cars"."id" ASC
|
428
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
429
|
+
[1m[35m (0.0ms)[0m begin transaction
|
430
|
+
--------------------------------------
|
431
|
+
CarTest: test_search_car_with_tags_AND
|
432
|
+
--------------------------------------
|
433
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
434
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
435
|
+
[1m[36mActsAsTaggableOn::Tag Load (0.8ms)[0m [1mSELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = ? AND "taggings"."taggable_type" = ? AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL)[0m [["taggable_id", 131351955], ["taggable_type", "Car"]]
|
436
|
+
[1m[35mSQL (0.3ms)[0m UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:28:37.589948"]]
|
437
|
+
[1m[36mActsAsTaggableOn::Tag Load (0.1ms)[0m [1mSELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('version_1') OR LOWER(name) = LOWER('version_2'))[0m
|
438
|
+
[1m[35mActsAsTaggableOn::Tag Exists (0.3ms)[0m SELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'version_1' LIMIT 1
|
439
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "tags" ("name") VALUES (?)[0m [["name", "version_1"]]
|
440
|
+
[1m[35mActsAsTaggableOn::Tag Exists (0.1ms)[0m SELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'version_2' LIMIT 1
|
441
|
+
[1m[36mSQL (0.0ms)[0m [1mINSERT INTO "tags" ("name") VALUES (?)[0m [["name", "version_2"]]
|
442
|
+
[1m[35mActsAsTaggableOn::Tag Load (0.0ms)[0m SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = ? AND "taggings"."taggable_type" = ? AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL) [["taggable_id", 131351955], ["taggable_type", "Car"]]
|
443
|
+
[1m[36mActsAsTaggableOn::Tagging Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "taggings" WHERE ("taggings"."tag_id" = 1 AND "taggings"."taggable_type" = 'Car' AND "taggings"."taggable_id" = 131351955 AND "taggings"."context" = 'tags' AND "taggings"."tagger_id" IS NULL AND "taggings"."tagger_type" IS NULL) LIMIT 1[0m
|
444
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type") VALUES (?, ?, ?, ?, ?) [["context", "tags"], ["created_at", "2014-11-14 15:28:37.700153"], ["tag_id", 1], ["taggable_id", 131351955], ["taggable_type", "Car"]]
|
445
|
+
[1m[36mActsAsTaggableOn::Tag Load (0.1ms)[0m [1mSELECT "tags".* FROM "tags" WHERE "tags"."id" = ? LIMIT 1[0m [["id", 1]]
|
446
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) + 1 WHERE "tags"."id" = 1
|
447
|
+
[1m[36mActsAsTaggableOn::Tagging Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "taggings" WHERE ("taggings"."tag_id" = 2 AND "taggings"."taggable_type" = 'Car' AND "taggings"."taggable_id" = 131351955 AND "taggings"."context" = 'tags' AND "taggings"."tagger_id" IS NULL AND "taggings"."tagger_type" IS NULL) LIMIT 1[0m
|
448
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type") VALUES (?, ?, ?, ?, ?) [["context", "tags"], ["created_at", "2014-11-14 15:28:37.704365"], ["tag_id", 2], ["taggable_id", 131351955], ["taggable_type", "Car"]]
|
449
|
+
[1m[36mActsAsTaggableOn::Tag Load (0.0ms)[0m [1mSELECT "tags".* FROM "tags" WHERE "tags"."id" = ? LIMIT 1[0m [["id", 2]]
|
450
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) + 1 WHERE "tags"."id" = 2
|
451
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
452
|
+
[1m[35mActsAsTaggableOn::Tag Load (0.1ms)[0m SELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('version_1') OR LOWER(name) = LOWER('version_2'))
|
453
|
+
[1m[36mCar Load (0.2ms)[0m [1mSELECT DISTINCT "cars".* FROM "cars" JOIN taggings cars_taggings_2853144 ON cars_taggings_2853144.taggable_id = cars.id AND cars_taggings_2853144.taggable_type = 'Car' AND cars_taggings_2853144.tag_id = 1 JOIN taggings cars_taggings_c3bea79 ON cars_taggings_c3bea79.taggable_id = cars.id AND cars_taggings_c3bea79.taggable_type = 'Car' AND cars_taggings_c3bea79.tag_id = 2 ORDER BY "cars"."id" ASC[0m
|
454
|
+
[1m[35m (0.4ms)[0m rollback transaction
|
455
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
456
|
+
-------------------------------------
|
457
|
+
CarTest: test_search_car_with_tags_OR
|
458
|
+
-------------------------------------
|
459
|
+
[1m[35mCar Load (0.1ms)[0m SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
|
460
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
461
|
+
[1m[35mActsAsTaggableOn::Tag Load (0.1ms)[0m SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = ? AND "taggings"."taggable_type" = ? AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL) [["taggable_id", 131351955], ["taggable_type", "Car"]]
|
462
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955[0m [["updated_at", "2014-11-14 15:28:37.712254"]]
|
463
|
+
[1m[35mActsAsTaggableOn::Tag Load (0.1ms)[0m SELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('version_1') OR LOWER(name) = LOWER('version_2'))
|
464
|
+
[1m[36mActsAsTaggableOn::Tag Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'version_1' LIMIT 1[0m
|
465
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "tags" ("name") VALUES (?) [["name", "version_1"]]
|
466
|
+
[1m[36mActsAsTaggableOn::Tag Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'version_2' LIMIT 1[0m
|
467
|
+
[1m[35mSQL (0.0ms)[0m INSERT INTO "tags" ("name") VALUES (?) [["name", "version_2"]]
|
468
|
+
[1m[36mActsAsTaggableOn::Tag Load (0.0ms)[0m [1mSELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = ? AND "taggings"."taggable_type" = ? AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL)[0m [["taggable_id", 131351955], ["taggable_type", "Car"]]
|
469
|
+
[1m[35mActsAsTaggableOn::Tagging Exists (0.1ms)[0m SELECT 1 AS one FROM "taggings" WHERE ("taggings"."tag_id" = 1 AND "taggings"."taggable_type" = 'Car' AND "taggings"."taggable_id" = 131351955 AND "taggings"."context" = 'tags' AND "taggings"."tagger_id" IS NULL AND "taggings"."tagger_type" IS NULL) LIMIT 1
|
470
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type") VALUES (?, ?, ?, ?, ?)[0m [["context", "tags"], ["created_at", "2014-11-14 15:28:37.718066"], ["tag_id", 1], ["taggable_id", 131351955], ["taggable_type", "Car"]]
|
471
|
+
[1m[35mActsAsTaggableOn::Tag Load (0.1ms)[0m SELECT "tags".* FROM "tags" WHERE "tags"."id" = ? LIMIT 1 [["id", 1]]
|
472
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) + 1 WHERE "tags"."id" = 1[0m
|
473
|
+
[1m[35mActsAsTaggableOn::Tagging Exists (0.1ms)[0m SELECT 1 AS one FROM "taggings" WHERE ("taggings"."tag_id" = 2 AND "taggings"."taggable_type" = 'Car' AND "taggings"."taggable_id" = 131351955 AND "taggings"."context" = 'tags' AND "taggings"."tagger_id" IS NULL AND "taggings"."tagger_type" IS NULL) LIMIT 1
|
474
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type") VALUES (?, ?, ?, ?, ?)[0m [["context", "tags"], ["created_at", "2014-11-14 15:28:37.722278"], ["tag_id", 2], ["taggable_id", 131351955], ["taggable_type", "Car"]]
|
475
|
+
[1m[35mActsAsTaggableOn::Tag Load (0.0ms)[0m SELECT "tags".* FROM "tags" WHERE "tags"."id" = ? LIMIT 1 [["id", 2]]
|
476
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) + 1 WHERE "tags"."id" = 2[0m
|
477
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
478
|
+
[1m[36mActsAsTaggableOn::Tag Load (0.1ms)[0m [1mSELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('version_1'))[0m
|
479
|
+
[1m[35mCar Load (0.2ms)[0m SELECT DISTINCT cars.*,cars.id FROM "cars" JOIN taggings cars_taggings_3c8a941 ON cars_taggings_3c8a941.taggable_id = cars.id AND cars_taggings_3c8a941.taggable_type = 'Car' WHERE (cars_taggings_3c8a941.tag_id = 1) GROUP BY cars.id ORDER BY "cars"."id" ASC
|
480
|
+
[1m[36m (0.4ms)[0m [1mrollback transaction[0m
|
481
|
+
[1m[35m (0.1ms)[0m begin transaction
|
482
|
+
-------------------------------------
|
483
|
+
CarTest: test_search_car_with_through
|
484
|
+
-------------------------------------
|
485
|
+
[1m[36mComponent Load (0.2ms)[0m [1mSELECT "components".* FROM "components" WHERE "components"."id" = ? LIMIT 1[0m [["id", 172444051]]
|
486
|
+
[1m[35mCar Load (0.1ms)[0m SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
|
487
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT DISTINCT "cars".* FROM "cars" INNER JOIN "doors" ON "doors"."car_id" = "cars"."id" WHERE "doors"."component_id" = 172444051 ORDER BY "cars"."id" ASC[0m
|
488
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
489
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
490
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
491
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
492
|
+
[1m[35mFixture Delete (0.2ms)[0m DELETE FROM "cars"
|
493
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "cars" ("name", "description", "number_of_doors", "brand", "model", "import_date", "kind", "created_at", "updated_at", "id", "group_id") VALUES ('Car One', 'This is Car One', 4, 'Brand One Ultimate', 'Model One', '1990-10-10', 0, '2014-11-14 15:57:41', '2014-11-14 15:57:41', 835429954, 972975755)[0m
|
494
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "cars" ("name", "description", "number_of_doors", "brand", "model", "import_date", "kind", "created_at", "updated_at", "id", "group_id") VALUES ('Car Two', 'This is Car Two', 3, 'Brand Two Ultimate', 'Model Two', '1990-10-15', 1, '2014-11-14 15:57:41', '2014-11-14 15:57:41', 443394774, 972975755)
|
495
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "cars" ("name", "description", "number_of_doors", "brand", "model", "import_date", "kind", "created_at", "updated_at", "id", "group_id") VALUES ('Car Foo foo Bar', 'This is Car Foo foo bar', 2, 'Brand Foo bar', 'Model Foo bar', '1990-10-20', 2, '2014-11-14 15:57:41', '2014-11-14 15:57:41', 131351955, 266440024)[0m
|
496
|
+
[1m[35mFixture Delete (0.1ms)[0m DELETE FROM "components"
|
497
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "components" ("name", "serial", "created_at", "updated_at", "id", "provider_id") VALUES ('Component one', 1234567890987654321, '2014-11-14 15:57:41', '2014-11-14 15:57:41', 1012443712, 665974588)[0m
|
498
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "components" ("name", "serial", "created_at", "updated_at", "id", "provider_id") VALUES ('Component two', 1234567890987654321, '2014-11-14 15:57:41', '2014-11-14 15:57:41', 402564824, 202898348)
|
499
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "components" ("name", "serial", "created_at", "updated_at", "id", "provider_id") VALUES ('Component foo', 1234567890987654321, '2014-11-14 15:57:41', '2014-11-14 15:57:41', 172444051, 296621295)[0m
|
500
|
+
[1m[35mFixture Delete (0.1ms)[0m DELETE FROM "doors"
|
501
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "doors" ("name", "created_at", "updated_at", "id", "car_id", "component_id") VALUES ('Door one', '2014-11-14 15:57:41', '2014-11-14 15:57:41', 546177811, 835429954, 1012443712)[0m
|
502
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "doors" ("name", "created_at", "updated_at", "id", "car_id", "component_id") VALUES ('Door Two', '2014-11-14 15:57:41', '2014-11-14 15:57:41', 187174789, 443394774, 402564824)
|
503
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "doors" ("name", "created_at", "updated_at", "id", "car_id", "component_id") VALUES ('Door Foo', '2014-11-14 15:57:41', '2014-11-14 15:57:41', 378659014, 131351955, 172444051)[0m
|
504
|
+
[1m[35mFixture Delete (0.1ms)[0m DELETE FROM "groups"
|
505
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "groups" ("name", "created_at", "updated_at", "id") VALUES ('Group one', '2014-11-14 15:57:41', '2014-11-14 15:57:41', 972975755)[0m
|
506
|
+
[1m[35mFixture Insert (0.0ms)[0m INSERT INTO "groups" ("name", "created_at", "updated_at", "id") VALUES ('Group foo', '2014-11-14 15:57:41', '2014-11-14 15:57:41', 266440024)
|
507
|
+
[1m[36mFixture Delete (0.1ms)[0m [1mDELETE FROM "providers"[0m
|
508
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "providers" ("name", "created_at", "updated_at", "id") VALUES ('Provider one', '2014-11-14 15:57:41', '2014-11-14 15:57:41', 665974588)
|
509
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "providers" ("name", "created_at", "updated_at", "id") VALUES ('Provider two', '2014-11-14 15:57:41', '2014-11-14 15:57:41', 202898348)[0m
|
510
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "providers" ("name", "created_at", "updated_at", "id") VALUES ('Provider foo', '2014-11-14 15:57:41', '2014-11-14 15:57:41', 296621295)
|
511
|
+
[1m[36m (5.1ms)[0m [1mcommit transaction[0m
|
512
|
+
[1m[35m (0.1ms)[0m begin transaction
|
513
|
+
-------------------------------------------------------
|
514
|
+
SearchableModelsTest: test_module_is_correctly_included
|
515
|
+
-------------------------------------------------------
|
516
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
517
|
+
[1m[35m (0.1ms)[0m begin transaction
|
518
|
+
------------------------------------------
|
519
|
+
CarTest: test_search_car_with_belong_to_id
|
520
|
+
------------------------------------------
|
521
|
+
[1m[36mGroup Load (0.2ms)[0m [1mSELECT "groups".* FROM "groups" WHERE "groups"."id" = ? LIMIT 1[0m [["id", 266440024]]
|
522
|
+
[1m[35mCar Load (0.2ms)[0m SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
|
523
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT DISTINCT "cars".* FROM "cars" WHERE "cars"."group_id" = 266440024 ORDER BY "cars"."id" ASC[0m
|
524
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
525
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
526
|
+
------------------------------------------
|
527
|
+
CarTest: test_search_car_with_deep_through
|
528
|
+
------------------------------------------
|
529
|
+
[1m[35mProvider Load (0.1ms)[0m SELECT "providers".* FROM "providers" WHERE "providers"."id" = ? LIMIT 1 [["id", 296621295]]
|
530
|
+
[1m[36mCar Load (0.0ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
531
|
+
[1m[35mCar Load (0.3ms)[0m SELECT DISTINCT "cars".* FROM "cars" INNER JOIN "doors" ON "doors"."car_id" = "cars"."id" INNER JOIN "components" ON "components"."id" = "doors"."component_id" WHERE "components"."provider_id" = 296621295 ORDER BY "cars"."id" ASC
|
532
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
533
|
+
[1m[35m (0.1ms)[0m begin transaction
|
534
|
+
----------------------------------
|
535
|
+
CarTest: test_search_car_with_enum
|
536
|
+
----------------------------------
|
537
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
538
|
+
[1m[35mCar Load (0.1ms)[0m SELECT DISTINCT "cars".* FROM "cars" WHERE "cars"."kind" = 2 ORDER BY "cars"."id" ASC
|
539
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
540
|
+
[1m[35m (0.0ms)[0m begin transaction
|
541
|
+
------------------------------------------
|
542
|
+
CarTest: test_search_car_with_exact_search
|
543
|
+
------------------------------------------
|
544
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
545
|
+
[1m[35mCar Load (0.1ms)[0m SELECT DISTINCT "cars".* FROM "cars" WHERE "cars"."number_of_doors" = 2 ORDER BY "cars"."id" ASC
|
546
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
547
|
+
[1m[35m (0.0ms)[0m begin transaction
|
548
|
+
-------------------------------------------------------------
|
549
|
+
CarTest: test_search_car_with_fuzzy_search_on_multiple_fields
|
550
|
+
-------------------------------------------------------------
|
551
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
552
|
+
[1m[35mCar Load (0.1ms)[0m SELECT DISTINCT "cars".* FROM "cars" WHERE ((LOWER(cars.name) like '%foo%' OR LOWER(cars.description) like '%foo%')) ORDER BY "cars"."id" ASC
|
553
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
554
|
+
[1m[35m (0.0ms)[0m begin transaction
|
555
|
+
-------------------------------------------------------
|
556
|
+
CarTest: test_search_car_with_fuzzy_search_on_one_field
|
557
|
+
-------------------------------------------------------
|
558
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
559
|
+
[1m[35mCar Load (0.1ms)[0m SELECT DISTINCT "cars".* FROM "cars" WHERE ((LOWER(cars.brand) like '%foo%')) ORDER BY "cars"."id" ASC
|
560
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
561
|
+
[1m[35m (0.0ms)[0m begin transaction
|
562
|
+
------------------------------------------------------------------------
|
563
|
+
CarTest: test_search_car_with_fuzzy_search_on_one_field_with_named_param
|
564
|
+
------------------------------------------------------------------------
|
565
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
566
|
+
[1m[35mCar Load (0.1ms)[0m SELECT DISTINCT "cars".* FROM "cars" WHERE ((LOWER(cars.model) like '%foo%')) ORDER BY "cars"."id" ASC
|
567
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
568
|
+
[1m[35m (0.1ms)[0m begin transaction
|
569
|
+
----------------------------------------
|
570
|
+
CarTest: test_search_car_with_i18n_field
|
571
|
+
----------------------------------------
|
572
|
+
[1m[36mCar Load (0.2ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
573
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
574
|
+
[1m[36mCar::Translation Load (0.1ms)[0m [1mSELECT "car_translations".* FROM "car_translations" WHERE "car_translations"."car_id" = ?[0m [["car_id", 131351955]]
|
575
|
+
[1m[35mSQL (0.2ms)[0m UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:57:41.504267"]]
|
576
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "car_translations" ("car_id", "commercial_name", "created_at", "locale", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["car_id", 131351955], ["commercial_name", "Commercial Name en"], ["created_at", "2014-11-14 15:57:41.509326"], ["locale", "en"], ["updated_at", "2014-11-14 15:57:41.509326"]]
|
577
|
+
[1m[35mCar Load (0.0ms)[0m SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
|
578
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "cars" SET "updated_at" = '2014-11-14 15:57:41.512816' WHERE "cars"."id" = 131351955[0m
|
579
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
580
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
581
|
+
[1m[35mSQL (1.6ms)[0m UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:57:41.514984"]]
|
582
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "car_translations" ("car_id", "commercial_name", "created_at", "locale", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["car_id", 131351955], ["commercial_name", "Commercial Name fr"], ["created_at", "2014-11-14 15:57:41.518198"], ["locale", "fr"], ["updated_at", "2014-11-14 15:57:41.518198"]]
|
583
|
+
[1m[35mCar Load (0.1ms)[0m SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
|
584
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "cars" SET "updated_at" = '2014-11-14 15:57:41.519983' WHERE "cars"."id" = 131351955[0m
|
585
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
586
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
587
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:57:41.522670"]]
|
588
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "car_translations" ("car_id", "commercial_name", "created_at", "locale", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["car_id", 131351955], ["commercial_name", "Commercial Name es"], ["created_at", "2014-11-14 15:57:41.524586"], ["locale", "es"], ["updated_at", "2014-11-14 15:57:41.524586"]]
|
589
|
+
[1m[35mCar Load (0.1ms)[0m SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
|
590
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "cars" SET "updated_at" = '2014-11-14 15:57:41.526170' WHERE "cars"."id" = 131351955[0m
|
591
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
592
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
593
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:57:41.528029"]]
|
594
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "car_translations" ("car_id", "commercial_name", "created_at", "locale", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["car_id", 131351955], ["commercial_name", "Commercial Name pt"], ["created_at", "2014-11-14 15:57:41.529330"], ["locale", "pt"], ["updated_at", "2014-11-14 15:57:41.529330"]]
|
595
|
+
[1m[35mCar Load (0.0ms)[0m SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
|
596
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "cars" SET "updated_at" = '2014-11-14 15:57:41.530601' WHERE "cars"."id" = 131351955[0m
|
597
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
598
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
599
|
+
[1m[35mSQL (0.0ms)[0m UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:57:41.532153"]]
|
600
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "car_translations" SET "commercial_name" = ?, "updated_at" = ? WHERE "car_translations"."id" = 4[0m [["commercial_name", "Commercial Name foobarish! pt"], ["updated_at", "2014-11-14 15:57:41.533068"]]
|
601
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "cars" SET "updated_at" = '2014-11-14 15:57:41.533554' WHERE "cars"."id" = 131351955
|
602
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
603
|
+
[1m[35mCar Load (0.1ms)[0m SELECT DISTINCT "cars".* FROM "cars" INNER JOIN "car_translations" ON "car_translations"."car_id" = "cars"."id" WHERE ((LOWER(car_translations.commercial_name) like '%bar%')) ORDER BY "cars"."id" ASC
|
604
|
+
[1m[36m (0.9ms)[0m [1mrollback transaction[0m
|
605
|
+
[1m[35m (0.0ms)[0m begin transaction
|
606
|
+
-----------------------------------
|
607
|
+
CarTest: test_search_car_with_scope
|
608
|
+
-----------------------------------
|
609
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
610
|
+
[1m[35mCar Load (0.2ms)[0m SELECT DISTINCT "cars".* FROM "cars" WHERE "cars"."import_date" = '1990-10-20' ORDER BY "cars"."id" ASC
|
611
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
612
|
+
[1m[35m (0.0ms)[0m begin transaction
|
613
|
+
--------------------------------------
|
614
|
+
CarTest: test_search_car_with_tags_AND
|
615
|
+
--------------------------------------
|
616
|
+
[1m[36mCar Load (0.1ms)[0m [1mSELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1[0m [["id", 131351955]]
|
617
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
618
|
+
[1m[36mActsAsTaggableOn::Tag Load (0.1ms)[0m [1mSELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = ? AND "taggings"."taggable_type" = ? AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL)[0m [["taggable_id", 131351955], ["taggable_type", "Car"]]
|
619
|
+
[1m[35mSQL (0.2ms)[0m UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:57:41.547627"]]
|
620
|
+
[1m[36mActsAsTaggableOn::Tag Load (0.2ms)[0m [1mSELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('version_1') OR LOWER(name) = LOWER('version_2'))[0m
|
621
|
+
[1m[35mActsAsTaggableOn::Tag Exists (0.1ms)[0m SELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'version_1' LIMIT 1
|
622
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "tags" ("name") VALUES (?)[0m [["name", "version_1"]]
|
623
|
+
[1m[35mActsAsTaggableOn::Tag Exists (0.1ms)[0m SELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'version_2' LIMIT 1
|
624
|
+
[1m[36mSQL (0.0ms)[0m [1mINSERT INTO "tags" ("name") VALUES (?)[0m [["name", "version_2"]]
|
625
|
+
[1m[35mActsAsTaggableOn::Tag Load (0.0ms)[0m SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = ? AND "taggings"."taggable_type" = ? AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL) [["taggable_id", 131351955], ["taggable_type", "Car"]]
|
626
|
+
[1m[36mActsAsTaggableOn::Tagging Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "taggings" WHERE ("taggings"."tag_id" = 1 AND "taggings"."taggable_type" = 'Car' AND "taggings"."taggable_id" = 131351955 AND "taggings"."context" = 'tags' AND "taggings"."tagger_id" IS NULL AND "taggings"."tagger_type" IS NULL) LIMIT 1[0m
|
627
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type") VALUES (?, ?, ?, ?, ?) [["context", "tags"], ["created_at", "2014-11-14 15:57:41.631821"], ["tag_id", 1], ["taggable_id", 131351955], ["taggable_type", "Car"]]
|
628
|
+
[1m[36mActsAsTaggableOn::Tag Load (0.1ms)[0m [1mSELECT "tags".* FROM "tags" WHERE "tags"."id" = ? LIMIT 1[0m [["id", 1]]
|
629
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) + 1 WHERE "tags"."id" = 1
|
630
|
+
[1m[36mActsAsTaggableOn::Tagging Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "taggings" WHERE ("taggings"."tag_id" = 2 AND "taggings"."taggable_type" = 'Car' AND "taggings"."taggable_id" = 131351955 AND "taggings"."context" = 'tags' AND "taggings"."tagger_id" IS NULL AND "taggings"."tagger_type" IS NULL) LIMIT 1[0m
|
631
|
+
[1m[35mSQL (0.0ms)[0m INSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type") VALUES (?, ?, ?, ?, ?) [["context", "tags"], ["created_at", "2014-11-14 15:57:41.635080"], ["tag_id", 2], ["taggable_id", 131351955], ["taggable_type", "Car"]]
|
632
|
+
[1m[36mActsAsTaggableOn::Tag Load (0.0ms)[0m [1mSELECT "tags".* FROM "tags" WHERE "tags"."id" = ? LIMIT 1[0m [["id", 2]]
|
633
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) + 1 WHERE "tags"."id" = 2
|
634
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
635
|
+
[1m[35mActsAsTaggableOn::Tag Load (0.2ms)[0m SELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('version_1') OR LOWER(name) = LOWER('version_2'))
|
636
|
+
[1m[36mCar Load (0.3ms)[0m [1mSELECT DISTINCT "cars".* FROM "cars" JOIN taggings cars_taggings_13087c7 ON cars_taggings_13087c7.taggable_id = cars.id AND cars_taggings_13087c7.taggable_type = 'Car' AND cars_taggings_13087c7.tag_id = 1 JOIN taggings cars_taggings_33d8cba ON cars_taggings_33d8cba.taggable_id = cars.id AND cars_taggings_33d8cba.taggable_type = 'Car' AND cars_taggings_33d8cba.tag_id = 2 ORDER BY "cars"."id" ASC[0m
|
637
|
+
[1m[35m (0.5ms)[0m rollback transaction
|
638
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
639
|
+
-------------------------------------
|
640
|
+
CarTest: test_search_car_with_tags_OR
|
641
|
+
-------------------------------------
|
642
|
+
[1m[35mCar Load (0.1ms)[0m SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
|
643
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
644
|
+
[1m[35mActsAsTaggableOn::Tag Load (0.1ms)[0m SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = ? AND "taggings"."taggable_type" = ? AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL) [["taggable_id", 131351955], ["taggable_type", "Car"]]
|
645
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955[0m [["updated_at", "2014-11-14 15:57:41.644474"]]
|
646
|
+
[1m[35mActsAsTaggableOn::Tag Load (0.1ms)[0m SELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('version_1') OR LOWER(name) = LOWER('version_2'))
|
647
|
+
[1m[36mActsAsTaggableOn::Tag Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'version_1' LIMIT 1[0m
|
648
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "tags" ("name") VALUES (?) [["name", "version_1"]]
|
649
|
+
[1m[36mActsAsTaggableOn::Tag Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'version_2' LIMIT 1[0m
|
650
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "tags" ("name") VALUES (?) [["name", "version_2"]]
|
651
|
+
[1m[36mActsAsTaggableOn::Tag Load (0.0ms)[0m [1mSELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = ? AND "taggings"."taggable_type" = ? AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL)[0m [["taggable_id", 131351955], ["taggable_type", "Car"]]
|
652
|
+
[1m[35mActsAsTaggableOn::Tagging Exists (0.1ms)[0m SELECT 1 AS one FROM "taggings" WHERE ("taggings"."tag_id" = 1 AND "taggings"."taggable_type" = 'Car' AND "taggings"."taggable_id" = 131351955 AND "taggings"."context" = 'tags' AND "taggings"."tagger_id" IS NULL AND "taggings"."tagger_type" IS NULL) LIMIT 1
|
653
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type") VALUES (?, ?, ?, ?, ?)[0m [["context", "tags"], ["created_at", "2014-11-14 15:57:41.651663"], ["tag_id", 1], ["taggable_id", 131351955], ["taggable_type", "Car"]]
|
654
|
+
[1m[35mActsAsTaggableOn::Tag Load (0.1ms)[0m SELECT "tags".* FROM "tags" WHERE "tags"."id" = ? LIMIT 1 [["id", 1]]
|
655
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) + 1 WHERE "tags"."id" = 1[0m
|
656
|
+
[1m[35mActsAsTaggableOn::Tagging Exists (0.1ms)[0m SELECT 1 AS one FROM "taggings" WHERE ("taggings"."tag_id" = 2 AND "taggings"."taggable_type" = 'Car' AND "taggings"."taggable_id" = 131351955 AND "taggings"."context" = 'tags' AND "taggings"."tagger_id" IS NULL AND "taggings"."tagger_type" IS NULL) LIMIT 1
|
657
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type") VALUES (?, ?, ?, ?, ?)[0m [["context", "tags"], ["created_at", "2014-11-14 15:57:41.654935"], ["tag_id", 2], ["taggable_id", 131351955], ["taggable_type", "Car"]]
|
658
|
+
[1m[35mActsAsTaggableOn::Tag Load (0.0ms)[0m SELECT "tags".* FROM "tags" WHERE "tags"."id" = ? LIMIT 1 [["id", 2]]
|
659
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) + 1 WHERE "tags"."id" = 2[0m
|
660
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
661
|
+
[1m[36mActsAsTaggableOn::Tag Load (0.1ms)[0m [1mSELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('version_1'))[0m
|
662
|
+
[1m[35mCar Load (0.2ms)[0m SELECT DISTINCT cars.*,cars.id FROM "cars" JOIN taggings cars_taggings_58e8c26 ON cars_taggings_58e8c26.taggable_id = cars.id AND cars_taggings_58e8c26.taggable_type = 'Car' WHERE (cars_taggings_58e8c26.tag_id = 1) GROUP BY cars.id ORDER BY "cars"."id" ASC
|
663
|
+
[1m[36m (0.7ms)[0m [1mrollback transaction[0m
|
664
|
+
[1m[35m (0.1ms)[0m begin transaction
|
665
|
+
-------------------------------------
|
666
|
+
CarTest: test_search_car_with_through
|
301
667
|
-------------------------------------
|
302
668
|
[1m[36mComponent Load (0.2ms)[0m [1mSELECT "components".* FROM "components" WHERE "components"."id" = ? LIMIT 1[0m [["id", 172444051]]
|
303
669
|
[1m[35mCar Load (0.1ms)[0m SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
|