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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9e62955eaa1d05c716d44e22d3193ae0cc6777c
4
- data.tar.gz: 753ea3a32ef65111c5830758af5019951dd6af44
3
+ metadata.gz: 9d004e320e0f031038e3f7eaf8cde613b0151aa2
4
+ data.tar.gz: 51672c6455b24c0b2348df3415515b5183331dce
5
5
  SHA512:
6
- metadata.gz: 66acdb4ecaf008930a5e870afd20e275daba8e6f34f141c6ff9ccdbf66f303a592ddd6d845a68e372cc6888cfb72803fa01fdce4303df62d930e80bf5d90cccb
7
- data.tar.gz: e5c168949a068fbfa843e8d0546225271f725753502c38d19b3f703eebf2af3fbc97203b855cfd3cd6dcc85cb4b410e1dbefe52b894aa9e876e8e6cd911b9627
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
- mattr_accessor :search_fields, :instance_accessor => false do
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 = search_fields.select do |_, v|
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 = search_fields.select { |_, v| v.try(:[], :mode) == :fuzzy }
18
+ fields = _search_fields.select { |_, v| v.try(:[], :mode) == :fuzzy }
24
19
  results = _fuzzy_search(results, fields, params)
25
20
 
26
- results.uniq.order(search_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.search_fields.merge!(args.first => args.extract_options!)
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.search_order = field
32
+ self._search_order = field
37
33
  end
38
34
 
39
35
  private
@@ -1,3 +1,3 @@
1
1
  module SearchableModels
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
Binary file
@@ -298,6 +298,372 @@ CarTest: test_search_car_with_tags_OR
298
298
   (0.1ms) begin transaction
299
299
  -------------------------------------
300
300
  CarTest: test_search_car_with_through
301
+ -------------------------------------
302
+ Component Load (0.2ms) SELECT "components".* FROM "components" WHERE "components"."id" = ? LIMIT 1 [["id", 172444051]]
303
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
304
+ Car Load (0.2ms) SELECT DISTINCT "cars".* FROM "cars" INNER JOIN "doors" ON "doors"."car_id" = "cars"."id" WHERE "doors"."component_id" = 172444051 ORDER BY "cars"."id" ASC
305
+  (0.1ms) rollback transaction
306
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
307
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
308
+  (0.1ms) begin transaction
309
+ Fixture Delete (0.5ms) DELETE FROM "cars"
310
+ Fixture Insert (0.4ms) INSERT 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)
311
+ Fixture Insert (0.1ms) 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
+ Fixture Insert (0.1ms) INSERT 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)
313
+ Fixture Delete (0.5ms) DELETE FROM "components"
314
+ Fixture Insert (0.1ms) INSERT 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)
315
+ Fixture Insert (0.1ms) 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
+ Fixture Insert (0.1ms) INSERT 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)
317
+ Fixture Delete (0.6ms) DELETE FROM "doors"
318
+ Fixture Insert (0.1ms) INSERT 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)
319
+ Fixture Insert (0.1ms) 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
+ Fixture Insert (0.1ms) INSERT 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)
321
+ Fixture Delete (0.1ms) DELETE FROM "groups"
322
+ Fixture Insert (0.0ms) INSERT INTO "groups" ("name", "created_at", "updated_at", "id") VALUES ('Group one', '2014-11-14 15:28:37', '2014-11-14 15:28:37', 972975755)
323
+ Fixture Insert (0.1ms) 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
+ Fixture Delete (0.1ms) DELETE FROM "providers"
325
+ Fixture Insert (0.0ms) 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
+ Fixture Insert (0.1ms) INSERT INTO "providers" ("name", "created_at", "updated_at", "id") VALUES ('Provider two', '2014-11-14 15:28:37', '2014-11-14 15:28:37', 202898348)
327
+ Fixture Insert (0.1ms) 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
+  (0.8ms) commit transaction
329
+  (0.1ms) begin transaction
330
+ -------------------------------------------------------
331
+ SearchableModelsTest: test_module_is_correctly_included
332
+ -------------------------------------------------------
333
+  (0.1ms) rollback transaction
334
+  (0.1ms) begin transaction
335
+ ------------------------------------------
336
+ CarTest: test_search_car_with_belong_to_id
337
+ ------------------------------------------
338
+ Group Load (0.2ms) SELECT "groups".* FROM "groups" WHERE "groups"."id" = ? LIMIT 1 [["id", 266440024]]
339
+ Car Load (0.2ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
340
+ Car Load (0.1ms) SELECT DISTINCT "cars".* FROM "cars" WHERE "cars"."group_id" = 266440024 ORDER BY "cars"."id" ASC
341
+  (0.1ms) rollback transaction
342
+  (0.0ms) begin transaction
343
+ ------------------------------------------
344
+ CarTest: test_search_car_with_deep_through
345
+ ------------------------------------------
346
+ Provider Load (0.1ms) SELECT "providers".* FROM "providers" WHERE "providers"."id" = ? LIMIT 1 [["id", 296621295]]
347
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
348
+ Car Load (0.3ms) 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
+  (0.1ms) rollback transaction
350
+  (0.1ms) begin transaction
351
+ ----------------------------------
352
+ CarTest: test_search_car_with_enum
353
+ ----------------------------------
354
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
355
+ Car Load (0.1ms) SELECT DISTINCT "cars".* FROM "cars" WHERE "cars"."kind" = 2 ORDER BY "cars"."id" ASC
356
+  (0.0ms) rollback transaction
357
+  (0.0ms) begin transaction
358
+ ------------------------------------------
359
+ CarTest: test_search_car_with_exact_search
360
+ ------------------------------------------
361
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
362
+ Car Load (0.1ms) SELECT DISTINCT "cars".* FROM "cars" WHERE "cars"."number_of_doors" = 2 ORDER BY "cars"."id" ASC
363
+  (0.0ms) rollback transaction
364
+  (0.1ms) begin transaction
365
+ -------------------------------------------------------------
366
+ CarTest: test_search_car_with_fuzzy_search_on_multiple_fields
367
+ -------------------------------------------------------------
368
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
369
+ Car Load (0.1ms) SELECT DISTINCT "cars".* FROM "cars" WHERE ((LOWER(cars.name) like '%foo%' OR LOWER(cars.description) like '%foo%')) ORDER BY "cars"."id" ASC
370
+  (0.1ms) rollback transaction
371
+  (0.0ms) begin transaction
372
+ -------------------------------------------------------
373
+ CarTest: test_search_car_with_fuzzy_search_on_one_field
374
+ -------------------------------------------------------
375
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
376
+ Car Load (0.1ms) SELECT DISTINCT "cars".* FROM "cars" WHERE ((LOWER(cars.brand) like '%foo%')) ORDER BY "cars"."id" ASC
377
+  (0.0ms) rollback transaction
378
+  (0.0ms) begin transaction
379
+ ------------------------------------------------------------------------
380
+ CarTest: test_search_car_with_fuzzy_search_on_one_field_with_named_param
381
+ ------------------------------------------------------------------------
382
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
383
+ Car Load (0.1ms) SELECT DISTINCT "cars".* FROM "cars" WHERE ((LOWER(cars.model) like '%foo%')) ORDER BY "cars"."id" ASC
384
+  (0.0ms) rollback transaction
385
+  (0.0ms) begin transaction
386
+ ----------------------------------------
387
+ CarTest: test_search_car_with_i18n_field
388
+ ----------------------------------------
389
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
390
+  (0.0ms) SAVEPOINT active_record_1
391
+ Car::Translation Load (0.5ms) SELECT "car_translations".* FROM "car_translations" WHERE "car_translations"."car_id" = ? [["car_id", 131351955]]
392
+ SQL (0.4ms) UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:28:37.533306"]]
393
+ SQL (0.8ms) INSERT INTO "car_translations" ("car_id", "commercial_name", "created_at", "locale", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
+ Car Load (0.2ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
395
+ SQL (0.1ms) UPDATE "cars" SET "updated_at" = '2014-11-14 15:28:37.549578' WHERE "cars"."id" = 131351955
396
+  (0.1ms) RELEASE SAVEPOINT active_record_1
397
+  (0.0ms) SAVEPOINT active_record_1
398
+ SQL (1.2ms) UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:28:37.553283"]]
399
+ SQL (0.2ms) INSERT INTO "car_translations" ("car_id", "commercial_name", "created_at", "locale", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
+ Car Load (0.0ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
401
+ SQL (0.1ms) UPDATE "cars" SET "updated_at" = '2014-11-14 15:28:37.557915' WHERE "cars"."id" = 131351955
402
+  (0.0ms) RELEASE SAVEPOINT active_record_1
403
+  (0.0ms) SAVEPOINT active_record_1
404
+ SQL (0.1ms) UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:28:37.559720"]]
405
+ SQL (0.1ms) INSERT INTO "car_translations" ("car_id", "commercial_name", "created_at", "locale", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
+ Car Load (0.0ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
407
+ SQL (0.1ms) UPDATE "cars" SET "updated_at" = '2014-11-14 15:28:37.562236' WHERE "cars"."id" = 131351955
408
+  (0.1ms) RELEASE SAVEPOINT active_record_1
409
+  (0.1ms) SAVEPOINT active_record_1
410
+ SQL (0.1ms) UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:28:37.565077"]]
411
+ SQL (0.1ms) INSERT INTO "car_translations" ("car_id", "commercial_name", "created_at", "locale", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
413
+ SQL (0.1ms) UPDATE "cars" SET "updated_at" = '2014-11-14 15:28:37.569955' WHERE "cars"."id" = 131351955
414
+  (0.0ms) RELEASE SAVEPOINT active_record_1
415
+  (0.0ms) SAVEPOINT active_record_1
416
+ SQL (0.1ms) UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:28:37.571673"]]
417
+ SQL (0.1ms) UPDATE "car_translations" SET "commercial_name" = ?, "updated_at" = ? WHERE "car_translations"."id" = 4 [["commercial_name", "Commercial Name foobarish! pt"], ["updated_at", "2014-11-14 15:28:37.572735"]]
418
+ SQL (0.1ms) UPDATE "cars" SET "updated_at" = '2014-11-14 15:28:37.573273' WHERE "cars"."id" = 131351955
419
+  (0.0ms) RELEASE SAVEPOINT active_record_1
420
+ Car Load (0.1ms) 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
+  (0.6ms) rollback transaction
422
+  (0.1ms) begin transaction
423
+ -----------------------------------
424
+ CarTest: test_search_car_with_scope
425
+ -----------------------------------
426
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
427
+ Car Load (0.1ms) SELECT DISTINCT "cars".* FROM "cars" WHERE "cars"."import_date" = '1990-10-20' ORDER BY "cars"."id" ASC
428
+  (0.0ms) rollback transaction
429
+  (0.0ms) begin transaction
430
+ --------------------------------------
431
+ CarTest: test_search_car_with_tags_AND
432
+ --------------------------------------
433
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
434
+  (0.0ms) SAVEPOINT active_record_1
435
+ ActsAsTaggableOn::Tag Load (0.8ms) 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"]]
436
+ SQL (0.3ms) UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:28:37.589948"]]
437
+ ActsAsTaggableOn::Tag Load (0.1ms) SELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('version_1') OR LOWER(name) = LOWER('version_2'))
438
+ ActsAsTaggableOn::Tag Exists (0.3ms) SELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'version_1' LIMIT 1
439
+ SQL (0.1ms) INSERT INTO "tags" ("name") VALUES (?) [["name", "version_1"]]
440
+ ActsAsTaggableOn::Tag Exists (0.1ms) SELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'version_2' LIMIT 1
441
+ SQL (0.0ms) INSERT INTO "tags" ("name") VALUES (?) [["name", "version_2"]]
442
+ ActsAsTaggableOn::Tag Load (0.0ms) 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
+ ActsAsTaggableOn::Tagging Exists (0.3ms) 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
444
+ SQL (0.3ms) 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
+ ActsAsTaggableOn::Tag Load (0.1ms) SELECT "tags".* FROM "tags" WHERE "tags"."id" = ? LIMIT 1 [["id", 1]]
446
+ SQL (0.1ms) UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) + 1 WHERE "tags"."id" = 1
447
+ ActsAsTaggableOn::Tagging Exists (0.1ms) 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
448
+ SQL (0.1ms) 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
+ ActsAsTaggableOn::Tag Load (0.0ms) SELECT "tags".* FROM "tags" WHERE "tags"."id" = ? LIMIT 1 [["id", 2]]
450
+ SQL (0.1ms) UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) + 1 WHERE "tags"."id" = 2
451
+  (0.0ms) RELEASE SAVEPOINT active_record_1
452
+ ActsAsTaggableOn::Tag Load (0.1ms) SELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('version_1') OR LOWER(name) = LOWER('version_2'))
453
+ Car Load (0.2ms) SELECT 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
454
+  (0.4ms) rollback transaction
455
+  (0.0ms) begin transaction
456
+ -------------------------------------
457
+ CarTest: test_search_car_with_tags_OR
458
+ -------------------------------------
459
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
460
+  (0.0ms) SAVEPOINT active_record_1
461
+ ActsAsTaggableOn::Tag Load (0.1ms) 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
+ SQL (0.2ms) UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:28:37.712254"]]
463
+ ActsAsTaggableOn::Tag Load (0.1ms) SELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('version_1') OR LOWER(name) = LOWER('version_2'))
464
+ ActsAsTaggableOn::Tag Exists (0.1ms) SELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'version_1' LIMIT 1
465
+ SQL (0.1ms) INSERT INTO "tags" ("name") VALUES (?) [["name", "version_1"]]
466
+ ActsAsTaggableOn::Tag Exists (0.1ms) SELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'version_2' LIMIT 1
467
+ SQL (0.0ms) INSERT INTO "tags" ("name") VALUES (?) [["name", "version_2"]]
468
+ ActsAsTaggableOn::Tag Load (0.0ms) 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"]]
469
+ ActsAsTaggableOn::Tagging Exists (0.1ms) 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
+ SQL (0.1ms) INSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type") VALUES (?, ?, ?, ?, ?) [["context", "tags"], ["created_at", "2014-11-14 15:28:37.718066"], ["tag_id", 1], ["taggable_id", 131351955], ["taggable_type", "Car"]]
471
+ ActsAsTaggableOn::Tag Load (0.1ms) SELECT "tags".* FROM "tags" WHERE "tags"."id" = ? LIMIT 1 [["id", 1]]
472
+ SQL (0.2ms) UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) + 1 WHERE "tags"."id" = 1
473
+ ActsAsTaggableOn::Tagging Exists (0.1ms) 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
+ SQL (0.1ms) INSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type") VALUES (?, ?, ?, ?, ?) [["context", "tags"], ["created_at", "2014-11-14 15:28:37.722278"], ["tag_id", 2], ["taggable_id", 131351955], ["taggable_type", "Car"]]
475
+ ActsAsTaggableOn::Tag Load (0.0ms) SELECT "tags".* FROM "tags" WHERE "tags"."id" = ? LIMIT 1 [["id", 2]]
476
+ SQL (0.1ms) UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) + 1 WHERE "tags"."id" = 2
477
+  (0.0ms) RELEASE SAVEPOINT active_record_1
478
+ ActsAsTaggableOn::Tag Load (0.1ms) SELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('version_1'))
479
+ Car Load (0.2ms) 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
+  (0.4ms) rollback transaction
481
+  (0.1ms) begin transaction
482
+ -------------------------------------
483
+ CarTest: test_search_car_with_through
484
+ -------------------------------------
485
+ Component Load (0.2ms) SELECT "components".* FROM "components" WHERE "components"."id" = ? LIMIT 1 [["id", 172444051]]
486
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
487
+ Car Load (0.1ms) SELECT DISTINCT "cars".* FROM "cars" INNER JOIN "doors" ON "doors"."car_id" = "cars"."id" WHERE "doors"."component_id" = 172444051 ORDER BY "cars"."id" ASC
488
+  (0.1ms) rollback transaction
489
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
490
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
491
+  (0.1ms) begin transaction
492
+ Fixture Delete (0.2ms) DELETE FROM "cars"
493
+ Fixture Insert (0.1ms) INSERT 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)
494
+ Fixture Insert (0.1ms) 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
+ Fixture Insert (0.1ms) INSERT 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)
496
+ Fixture Delete (0.1ms) DELETE FROM "components"
497
+ Fixture Insert (0.1ms) INSERT 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)
498
+ Fixture Insert (0.1ms) 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
+ Fixture Insert (0.1ms) INSERT 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)
500
+ Fixture Delete (0.1ms) DELETE FROM "doors"
501
+ Fixture Insert (0.1ms) INSERT 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)
502
+ Fixture Insert (0.1ms) 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
+ Fixture Insert (0.1ms) INSERT 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)
504
+ Fixture Delete (0.1ms) DELETE FROM "groups"
505
+ Fixture Insert (0.1ms) INSERT INTO "groups" ("name", "created_at", "updated_at", "id") VALUES ('Group one', '2014-11-14 15:57:41', '2014-11-14 15:57:41', 972975755)
506
+ Fixture Insert (0.0ms) 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
+ Fixture Delete (0.1ms) DELETE FROM "providers"
508
+ Fixture Insert (0.1ms) 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
+ Fixture Insert (0.0ms) INSERT INTO "providers" ("name", "created_at", "updated_at", "id") VALUES ('Provider two', '2014-11-14 15:57:41', '2014-11-14 15:57:41', 202898348)
510
+ Fixture Insert (0.1ms) 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
+  (5.1ms) commit transaction
512
+  (0.1ms) begin transaction
513
+ -------------------------------------------------------
514
+ SearchableModelsTest: test_module_is_correctly_included
515
+ -------------------------------------------------------
516
+  (0.1ms) rollback transaction
517
+  (0.1ms) begin transaction
518
+ ------------------------------------------
519
+ CarTest: test_search_car_with_belong_to_id
520
+ ------------------------------------------
521
+ Group Load (0.2ms) SELECT "groups".* FROM "groups" WHERE "groups"."id" = ? LIMIT 1 [["id", 266440024]]
522
+ Car Load (0.2ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
523
+ Car Load (0.1ms) SELECT DISTINCT "cars".* FROM "cars" WHERE "cars"."group_id" = 266440024 ORDER BY "cars"."id" ASC
524
+  (0.1ms) rollback transaction
525
+  (0.0ms) begin transaction
526
+ ------------------------------------------
527
+ CarTest: test_search_car_with_deep_through
528
+ ------------------------------------------
529
+ Provider Load (0.1ms) SELECT "providers".* FROM "providers" WHERE "providers"."id" = ? LIMIT 1 [["id", 296621295]]
530
+ Car Load (0.0ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
531
+ Car Load (0.3ms) 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
+  (0.1ms) rollback transaction
533
+  (0.1ms) begin transaction
534
+ ----------------------------------
535
+ CarTest: test_search_car_with_enum
536
+ ----------------------------------
537
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
538
+ Car Load (0.1ms) SELECT DISTINCT "cars".* FROM "cars" WHERE "cars"."kind" = 2 ORDER BY "cars"."id" ASC
539
+  (0.1ms) rollback transaction
540
+  (0.0ms) begin transaction
541
+ ------------------------------------------
542
+ CarTest: test_search_car_with_exact_search
543
+ ------------------------------------------
544
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
545
+ Car Load (0.1ms) SELECT DISTINCT "cars".* FROM "cars" WHERE "cars"."number_of_doors" = 2 ORDER BY "cars"."id" ASC
546
+  (0.1ms) rollback transaction
547
+  (0.0ms) begin transaction
548
+ -------------------------------------------------------------
549
+ CarTest: test_search_car_with_fuzzy_search_on_multiple_fields
550
+ -------------------------------------------------------------
551
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
552
+ Car Load (0.1ms) SELECT DISTINCT "cars".* FROM "cars" WHERE ((LOWER(cars.name) like '%foo%' OR LOWER(cars.description) like '%foo%')) ORDER BY "cars"."id" ASC
553
+  (0.1ms) rollback transaction
554
+  (0.0ms) begin transaction
555
+ -------------------------------------------------------
556
+ CarTest: test_search_car_with_fuzzy_search_on_one_field
557
+ -------------------------------------------------------
558
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
559
+ Car Load (0.1ms) SELECT DISTINCT "cars".* FROM "cars" WHERE ((LOWER(cars.brand) like '%foo%')) ORDER BY "cars"."id" ASC
560
+  (0.1ms) rollback transaction
561
+  (0.0ms) begin transaction
562
+ ------------------------------------------------------------------------
563
+ CarTest: test_search_car_with_fuzzy_search_on_one_field_with_named_param
564
+ ------------------------------------------------------------------------
565
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
566
+ Car Load (0.1ms) SELECT DISTINCT "cars".* FROM "cars" WHERE ((LOWER(cars.model) like '%foo%')) ORDER BY "cars"."id" ASC
567
+  (0.1ms) rollback transaction
568
+  (0.1ms) begin transaction
569
+ ----------------------------------------
570
+ CarTest: test_search_car_with_i18n_field
571
+ ----------------------------------------
572
+ Car Load (0.2ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
573
+  (0.1ms) SAVEPOINT active_record_1
574
+ Car::Translation Load (0.1ms) SELECT "car_translations".* FROM "car_translations" WHERE "car_translations"."car_id" = ? [["car_id", 131351955]]
575
+ SQL (0.2ms) UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:57:41.504267"]]
576
+ SQL (0.2ms) INSERT INTO "car_translations" ("car_id", "commercial_name", "created_at", "locale", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
+ Car Load (0.0ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
578
+ SQL (0.1ms) UPDATE "cars" SET "updated_at" = '2014-11-14 15:57:41.512816' WHERE "cars"."id" = 131351955
579
+  (0.0ms) RELEASE SAVEPOINT active_record_1
580
+  (0.0ms) SAVEPOINT active_record_1
581
+ SQL (1.6ms) UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:57:41.514984"]]
582
+ SQL (0.2ms) INSERT INTO "car_translations" ("car_id", "commercial_name", "created_at", "locale", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
584
+ SQL (0.1ms) UPDATE "cars" SET "updated_at" = '2014-11-14 15:57:41.519983' WHERE "cars"."id" = 131351955
585
+  (0.1ms) RELEASE SAVEPOINT active_record_1
586
+  (0.1ms) SAVEPOINT active_record_1
587
+ SQL (0.1ms) UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:57:41.522670"]]
588
+ SQL (0.1ms) INSERT INTO "car_translations" ("car_id", "commercial_name", "created_at", "locale", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
590
+ SQL (0.1ms) UPDATE "cars" SET "updated_at" = '2014-11-14 15:57:41.526170' WHERE "cars"."id" = 131351955
591
+  (0.0ms) RELEASE SAVEPOINT active_record_1
592
+  (0.1ms) SAVEPOINT active_record_1
593
+ SQL (0.1ms) UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:57:41.528029"]]
594
+ SQL (0.1ms) INSERT INTO "car_translations" ("car_id", "commercial_name", "created_at", "locale", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
+ Car Load (0.0ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
596
+ SQL (0.1ms) UPDATE "cars" SET "updated_at" = '2014-11-14 15:57:41.530601' WHERE "cars"."id" = 131351955
597
+  (0.0ms) RELEASE SAVEPOINT active_record_1
598
+  (0.0ms) SAVEPOINT active_record_1
599
+ SQL (0.0ms) UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:57:41.532153"]]
600
+ SQL (0.1ms) UPDATE "car_translations" SET "commercial_name" = ?, "updated_at" = ? WHERE "car_translations"."id" = 4 [["commercial_name", "Commercial Name foobarish! pt"], ["updated_at", "2014-11-14 15:57:41.533068"]]
601
+ SQL (0.1ms) UPDATE "cars" SET "updated_at" = '2014-11-14 15:57:41.533554' WHERE "cars"."id" = 131351955
602
+  (0.0ms) RELEASE SAVEPOINT active_record_1
603
+ Car Load (0.1ms) 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
+  (0.9ms) rollback transaction
605
+  (0.0ms) begin transaction
606
+ -----------------------------------
607
+ CarTest: test_search_car_with_scope
608
+ -----------------------------------
609
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
610
+ Car Load (0.2ms) SELECT DISTINCT "cars".* FROM "cars" WHERE "cars"."import_date" = '1990-10-20' ORDER BY "cars"."id" ASC
611
+  (0.1ms) rollback transaction
612
+  (0.0ms) begin transaction
613
+ --------------------------------------
614
+ CarTest: test_search_car_with_tags_AND
615
+ --------------------------------------
616
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
617
+  (0.0ms) SAVEPOINT active_record_1
618
+ ActsAsTaggableOn::Tag Load (0.1ms) 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"]]
619
+ SQL (0.2ms) UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:57:41.547627"]]
620
+ ActsAsTaggableOn::Tag Load (0.2ms) SELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('version_1') OR LOWER(name) = LOWER('version_2'))
621
+ ActsAsTaggableOn::Tag Exists (0.1ms) SELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'version_1' LIMIT 1
622
+ SQL (0.1ms) INSERT INTO "tags" ("name") VALUES (?) [["name", "version_1"]]
623
+ ActsAsTaggableOn::Tag Exists (0.1ms) SELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'version_2' LIMIT 1
624
+ SQL (0.0ms) INSERT INTO "tags" ("name") VALUES (?) [["name", "version_2"]]
625
+ ActsAsTaggableOn::Tag Load (0.0ms) 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
+ ActsAsTaggableOn::Tagging Exists (0.1ms) 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
627
+ SQL (0.1ms) 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
+ ActsAsTaggableOn::Tag Load (0.1ms) SELECT "tags".* FROM "tags" WHERE "tags"."id" = ? LIMIT 1 [["id", 1]]
629
+ SQL (0.1ms) UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) + 1 WHERE "tags"."id" = 1
630
+ ActsAsTaggableOn::Tagging Exists (0.1ms) 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
631
+ SQL (0.0ms) 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
+ ActsAsTaggableOn::Tag Load (0.0ms) SELECT "tags".* FROM "tags" WHERE "tags"."id" = ? LIMIT 1 [["id", 2]]
633
+ SQL (0.1ms) UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) + 1 WHERE "tags"."id" = 2
634
+  (0.1ms) RELEASE SAVEPOINT active_record_1
635
+ ActsAsTaggableOn::Tag Load (0.2ms) SELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('version_1') OR LOWER(name) = LOWER('version_2'))
636
+ Car Load (0.3ms) SELECT 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
637
+  (0.5ms) rollback transaction
638
+  (0.1ms) begin transaction
639
+ -------------------------------------
640
+ CarTest: test_search_car_with_tags_OR
641
+ -------------------------------------
642
+ Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
643
+  (0.1ms) SAVEPOINT active_record_1
644
+ ActsAsTaggableOn::Tag Load (0.1ms) 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
+ SQL (0.2ms) UPDATE "cars" SET "updated_at" = ? WHERE "cars"."id" = 131351955 [["updated_at", "2014-11-14 15:57:41.644474"]]
646
+ ActsAsTaggableOn::Tag Load (0.1ms) SELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('version_1') OR LOWER(name) = LOWER('version_2'))
647
+ ActsAsTaggableOn::Tag Exists (0.1ms) SELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'version_1' LIMIT 1
648
+ SQL (0.1ms) INSERT INTO "tags" ("name") VALUES (?) [["name", "version_1"]]
649
+ ActsAsTaggableOn::Tag Exists (0.1ms) SELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'version_2' LIMIT 1
650
+ SQL (0.1ms) INSERT INTO "tags" ("name") VALUES (?) [["name", "version_2"]]
651
+ ActsAsTaggableOn::Tag Load (0.0ms) 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"]]
652
+ ActsAsTaggableOn::Tagging Exists (0.1ms) 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
+ SQL (0.1ms) INSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type") VALUES (?, ?, ?, ?, ?) [["context", "tags"], ["created_at", "2014-11-14 15:57:41.651663"], ["tag_id", 1], ["taggable_id", 131351955], ["taggable_type", "Car"]]
654
+ ActsAsTaggableOn::Tag Load (0.1ms) SELECT "tags".* FROM "tags" WHERE "tags"."id" = ? LIMIT 1 [["id", 1]]
655
+ SQL (0.1ms) UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) + 1 WHERE "tags"."id" = 1
656
+ ActsAsTaggableOn::Tagging Exists (0.1ms) 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
+ SQL (0.1ms) INSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type") VALUES (?, ?, ?, ?, ?) [["context", "tags"], ["created_at", "2014-11-14 15:57:41.654935"], ["tag_id", 2], ["taggable_id", 131351955], ["taggable_type", "Car"]]
658
+ ActsAsTaggableOn::Tag Load (0.0ms) SELECT "tags".* FROM "tags" WHERE "tags"."id" = ? LIMIT 1 [["id", 2]]
659
+ SQL (0.1ms) UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) + 1 WHERE "tags"."id" = 2
660
+  (0.1ms) RELEASE SAVEPOINT active_record_1
661
+ ActsAsTaggableOn::Tag Load (0.1ms) SELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('version_1'))
662
+ Car Load (0.2ms) 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
+  (0.7ms) rollback transaction
664
+  (0.1ms) begin transaction
665
+ -------------------------------------
666
+ CarTest: test_search_car_with_through
301
667
  -------------------------------------
302
668
  Component Load (0.2ms) SELECT "components".* FROM "components" WHERE "components"."id" = ? LIMIT 1 [["id", 172444051]]
303
669
  Car Load (0.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."id" = ? LIMIT 1 [["id", 131351955]]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchable_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Fernandez