activerecord_any_of 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8fbc387a6c367d20f242594b77938c428e152a61
4
- data.tar.gz: ac60682ccb9a6ad90dce8f6239a0c7af516092cf
3
+ metadata.gz: 2eb1c3bc8c812cafeac5742eda463f36a1517336
4
+ data.tar.gz: 9e1c425f8faf771056efa3af3c38dcec05ed7353
5
5
  SHA512:
6
- metadata.gz: ae3cd4256c54bb9d4f854b818d457d148cf2bda22d30941381924a7b026d8da001d47b0b6fe76cb7659fe9a65d86936fa078e5c849132fac6cf299819d3a5350
7
- data.tar.gz: efab5a39c488004a6c98f30967d55e670c5afc2395bd5184d3f6c7018cf86937a05f1b11acb5035688774092870a01848f3e09940ad8a71df3000355135ed0e9
6
+ metadata.gz: 9093159a107a57d4f94e01aaea598e8e66f37b138e7d211be6bdd60f0946d22d98253d2a00999a8783b78d4d131687dbf9305e86f7c448d3529cd38ec3928277
7
+ data.tar.gz: a18604f93e8fb7ba4fca299a2c376a16a9e641109bb37edcc6b2ec267924ac7a80bc2d97e6160d6542b92afa3698ed6804031d8b4982cb94362703b9a26036fd
@@ -66,7 +66,7 @@ module ActiverecordAnyOf
66
66
  private
67
67
 
68
68
  def with_statement_cache
69
- if queries_bind_values.any?
69
+ if queries && queries_bind_values.any?
70
70
  relation = where([queries.reduce(:or).to_sql, *queries_bind_values.map { |v| v[1] }])
71
71
  else
72
72
  relation = where(queries.reduce(:or).to_sql)
@@ -86,13 +86,13 @@ module ActiverecordAnyOf
86
86
 
87
87
  def with_statement_cache
88
88
  if Rails.version >= '4'
89
- if queries_bind_values.any?
89
+ if queries && queries_bind_values.any?
90
90
  relation = where.not([queries.reduce(:or).to_sql, *queries_bind_values.map { |v| v[1] }])
91
91
  else
92
92
  relation = where.not(queries.reduce(:or).to_sql)
93
93
  end
94
94
  else
95
- if queries_bind_values.any?
95
+ if queries && queries_bind_values.any?
96
96
  relation = where([Arel::Nodes::Not.new(queries.reduce(:or)).to_sql, *queries_bind_values.map { |v| v[1] }])
97
97
  else
98
98
  relation = where(Arel::Nodes::Not.new(queries.reduce(:or)).to_sql)
@@ -1,3 +1,3 @@
1
1
  module ActiverecordAnyOf
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
Binary file
@@ -2489,3 +2489,99 @@ Connecting to database specified by database.yml
2489
2489
  Author Load (0.0ms) SELECT "authors".* FROM "authors" WHERE "authors"."name" = 'David' LIMIT 1
2490
2490
  Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."author_id" = 1 AND (NOT (("posts"."author_id" = 1 AND "posts"."body" = 'Such a lovely day' OR "posts"."author_id" = 1 AND "posts"."type" = 'SpecialPost')))
2491
2491
   (0.0ms) rollback transaction
2492
+ Connecting to database specified by database.yml
2493
+  (0.5ms) begin transaction
2494
+ Fixture Delete (0.2ms) DELETE FROM "authors"
2495
+ Fixture Insert (0.1ms) INSERT INTO "authors" ("id", "name", "created_at", "updated_at") VALUES (1, 'David', '2013-08-30 17:04:37', '2013-08-30 17:04:37')
2496
+ Fixture Insert (0.1ms) INSERT INTO "authors" ("id", "name", "created_at", "updated_at") VALUES (2, 'Mary', '2013-08-30 17:04:37', '2013-08-30 17:04:37')
2497
+ Fixture Insert (0.1ms) INSERT INTO "authors" ("id", "name", "created_at", "updated_at") VALUES (3, 'Bob', '2013-08-30 17:04:37', '2013-08-30 17:04:37')
2498
+ Fixture Delete (0.0ms) DELETE FROM "posts"
2499
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (1, 1, 'Welcome to the weblog', 'Such a lovely day', 'Post', '2013-08-30 17:04:37', '2013-08-30 17:04:37')
2500
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (2, 1, 'So I was thinking', 'Like I hopefully always am', 'SpecialPost', '2013-08-30 17:04:37', '2013-08-30 17:04:37')
2501
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (3, 0, 'I don''t have any comments', 'I just don''t want to', 'Post', '2013-08-30 17:04:37', '2013-08-30 17:04:37')
2502
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (4, 1, 'sti comments', 'hello', 'Post', '2013-08-30 17:04:37', '2013-08-30 17:04:37')
2503
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (5, 1, 'sti me', 'hello', 'StiPost', '2013-08-30 17:04:37', '2013-08-30 17:04:37')
2504
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (6, 1, 'habtm sti test', 'hello', 'Post', '2013-08-30 17:04:37', '2013-08-30 17:04:37')
2505
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (7, 2, 'eager loading with OR''d conditions', 'hello', 'Post', '2013-08-30 17:04:37', '2013-08-30 17:04:37')
2506
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (8, 3, 'misc post by bob', 'hello', 'Post', '2013-08-30 17:04:37', '2013-08-30 17:04:37')
2507
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (9, 2, 'misc post by mary', 'hello', 'Post', '2013-08-30 17:04:37', '2013-08-30 17:04:37')
2508
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (10, 3, 'other post by bob', 'hello', 'Post', '2013-08-30 17:04:37', '2013-08-30 17:04:37')
2509
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (11, 2, 'other post by mary', 'hello', 'Post', '2013-08-30 17:04:37', '2013-08-30 17:04:37')
2510
+  (279.5ms) commit transaction
2511
+  (0.1ms) begin transaction
2512
+ Author Load (0.2ms) SELECT "authors".* FROM "authors" WHERE (name like '%av%') AND (("authors"."name" = 'David' AND (name like '%av%') OR "authors"."name" = 'Mary' AND (name like '%av%')))
2513
+  (0.0ms) rollback transaction
2514
+  (0.0ms) begin transaction
2515
+  (0.0ms) rollback transaction
2516
+  (0.0ms) begin transaction
2517
+  (0.0ms) rollback transaction
2518
+  (0.0ms) begin transaction
2519
+ Author Load (0.1ms) SELECT "authors".* FROM "authors" INNER JOIN "posts" ON "posts"."author_id" = "authors"."id" WHERE (("posts"."title" = 'Welcome to the weblog' OR "posts"."title" = 'eager loading with OR''d conditions'))
2520
+ SQL (0.1ms) SELECT "authors"."id" AS t0_r0, "authors"."name" AS t0_r1, "authors"."created_at" AS t0_r2, "authors"."updated_at" AS t0_r3, "posts"."id" AS t1_r0, "posts"."title" AS t1_r1, "posts"."body" AS t1_r2, "posts"."author_id" AS t1_r3, "posts"."type" AS t1_r4, "posts"."created_at" AS t1_r5, "posts"."updated_at" AS t1_r6 FROM "authors" LEFT OUTER JOIN "posts" ON "posts"."author_id" = "authors"."id" WHERE (("posts"."title" = 'Welcome to the weblog' OR "posts"."title" = 'eager loading with OR''d conditions'))
2521
+  (0.0ms) rollback transaction
2522
+  (0.0ms) begin transaction
2523
+ Author Load (0.1ms) SELECT "authors".* FROM "authors" WHERE (("authors"."name" = 'David' OR "authors"."name" = 'Mary'))
2524
+ Author Load (0.0ms) SELECT "authors".* FROM "authors" WHERE (("authors"."name" = 'David' OR (name = 'Mary')))
2525
+ Author Load (0.0ms) SELECT "authors".* FROM "authors" WHERE ((("authors"."name" = 'David' OR (name = 'Mary')) OR "authors"."name" = 'Bob'))
2526
+ Author Load (0.0ms) SELECT "authors".* FROM "authors" WHERE ((("authors"."name" = 'David' OR (name = 'Mary')) OR "authors"."name" = 'Bob' AND "authors"."id" = 3))
2527
+ Author Load (0.0ms) SELECT "authors".* FROM "authors" WHERE (name IS NOT 'Mary') AND (("authors"."name" = 'David' OR (name IS NOT 'Mary') AND (name = 'Mary')))
2528
+  (0.0ms) rollback transaction
2529
+  (0.0ms) begin transaction
2530
+ Author Load (0.0ms) SELECT "authors".* FROM "authors" WHERE "authors"."name" = 'David' LIMIT 1
2531
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."author_id" = 1 AND (("posts"."author_id" = 1 AND "posts"."body" = 'Such a lovely day' OR "posts"."author_id" = 1 AND "posts"."type" = 'SpecialPost'))
2532
+  (0.0ms) rollback transaction
2533
+  (0.0ms) begin transaction
2534
+ Author Load (0.1ms) SELECT "authors".* FROM "authors" WHERE (NOT (("authors"."name" = 'David' OR "authors"."name" = 'Mary')))
2535
+  (0.0ms) rollback transaction
2536
+  (0.0ms) begin transaction
2537
+ Author Load (0.0ms) SELECT "authors".* FROM "authors" WHERE "authors"."name" = 'David' LIMIT 1
2538
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."author_id" = 1 AND (NOT (("posts"."author_id" = 1 AND "posts"."body" = 'Such a lovely day' OR "posts"."author_id" = 1 AND "posts"."type" = 'SpecialPost')))
2539
+  (0.0ms) rollback transaction
2540
+ Connecting to database specified by database.yml
2541
+  (0.2ms) begin transaction
2542
+ Fixture Delete (0.1ms) DELETE FROM "authors"
2543
+ Fixture Insert (0.1ms) INSERT INTO "authors" ("id", "name", "created_at", "updated_at") VALUES (1, 'David', '2013-08-30 17:24:41', '2013-08-30 17:24:41')
2544
+ Fixture Insert (0.0ms) INSERT INTO "authors" ("id", "name", "created_at", "updated_at") VALUES (2, 'Mary', '2013-08-30 17:24:41', '2013-08-30 17:24:41')
2545
+ Fixture Insert (0.0ms) INSERT INTO "authors" ("id", "name", "created_at", "updated_at") VALUES (3, 'Bob', '2013-08-30 17:24:41', '2013-08-30 17:24:41')
2546
+ Fixture Delete (0.0ms) DELETE FROM "posts"
2547
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (1, 1, 'Welcome to the weblog', 'Such a lovely day', 'Post', '2013-08-30 17:24:41', '2013-08-30 17:24:41')
2548
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (2, 1, 'So I was thinking', 'Like I hopefully always am', 'SpecialPost', '2013-08-30 17:24:41', '2013-08-30 17:24:41')
2549
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (3, 0, 'I don''t have any comments', 'I just don''t want to', 'Post', '2013-08-30 17:24:41', '2013-08-30 17:24:41')
2550
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (4, 1, 'sti comments', 'hello', 'Post', '2013-08-30 17:24:41', '2013-08-30 17:24:41')
2551
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (5, 1, 'sti me', 'hello', 'StiPost', '2013-08-30 17:24:41', '2013-08-30 17:24:41')
2552
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (6, 1, 'habtm sti test', 'hello', 'Post', '2013-08-30 17:24:41', '2013-08-30 17:24:41')
2553
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (7, 2, 'eager loading with OR''d conditions', 'hello', 'Post', '2013-08-30 17:24:41', '2013-08-30 17:24:41')
2554
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (8, 3, 'misc post by bob', 'hello', 'Post', '2013-08-30 17:24:41', '2013-08-30 17:24:41')
2555
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (9, 2, 'misc post by mary', 'hello', 'Post', '2013-08-30 17:24:41', '2013-08-30 17:24:41')
2556
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (10, 3, 'other post by bob', 'hello', 'Post', '2013-08-30 17:24:41', '2013-08-30 17:24:41')
2557
+ Fixture Insert (0.0ms) INSERT INTO "posts" ("id", "author_id", "title", "body", "type", "created_at", "updated_at") VALUES (11, 2, 'other post by mary', 'hello', 'Post', '2013-08-30 17:24:41', '2013-08-30 17:24:41')
2558
+  (808.0ms) commit transaction
2559
+  (0.1ms) begin transaction
2560
+ Author Load (0.2ms) SELECT "authors".* FROM "authors" WHERE (name like '%av%') AND (("authors"."name" = 'David' AND (name like '%av%') OR "authors"."name" = 'Mary' AND (name like '%av%')))
2561
+  (0.0ms) rollback transaction
2562
+  (0.0ms) begin transaction
2563
+  (0.0ms) rollback transaction
2564
+  (0.0ms) begin transaction
2565
+  (0.0ms) rollback transaction
2566
+  (0.0ms) begin transaction
2567
+ Author Load (0.1ms) SELECT "authors".* FROM "authors" INNER JOIN "posts" ON "posts"."author_id" = "authors"."id" WHERE (("posts"."title" = 'Welcome to the weblog' OR "posts"."title" = 'eager loading with OR''d conditions'))
2568
+ SQL (0.1ms) SELECT "authors"."id" AS t0_r0, "authors"."name" AS t0_r1, "authors"."created_at" AS t0_r2, "authors"."updated_at" AS t0_r3, "posts"."id" AS t1_r0, "posts"."title" AS t1_r1, "posts"."body" AS t1_r2, "posts"."author_id" AS t1_r3, "posts"."type" AS t1_r4, "posts"."created_at" AS t1_r5, "posts"."updated_at" AS t1_r6 FROM "authors" LEFT OUTER JOIN "posts" ON "posts"."author_id" = "authors"."id" WHERE (("posts"."title" = 'Welcome to the weblog' OR "posts"."title" = 'eager loading with OR''d conditions'))
2569
+  (0.0ms) rollback transaction
2570
+  (0.0ms) begin transaction
2571
+ Author Load (0.1ms) SELECT "authors".* FROM "authors" WHERE (("authors"."name" = 'David' OR "authors"."name" = 'Mary'))
2572
+ Author Load (0.0ms) SELECT "authors".* FROM "authors" WHERE (("authors"."name" = 'David' OR (name = 'Mary')))
2573
+ Author Load (0.0ms) SELECT "authors".* FROM "authors" WHERE ((("authors"."name" = 'David' OR (name = 'Mary')) OR "authors"."name" = 'Bob'))
2574
+ Author Load (0.0ms) SELECT "authors".* FROM "authors" WHERE ((("authors"."name" = 'David' OR (name = 'Mary')) OR "authors"."name" = 'Bob' AND "authors"."id" = 3))
2575
+ Author Load (0.0ms) SELECT "authors".* FROM "authors" WHERE (name IS NOT 'Mary') AND (("authors"."name" = 'David' OR (name IS NOT 'Mary') AND (name = 'Mary')))
2576
+  (0.0ms) rollback transaction
2577
+  (0.0ms) begin transaction
2578
+ Author Load (0.0ms) SELECT "authors".* FROM "authors" WHERE "authors"."name" = 'David' LIMIT 1
2579
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."author_id" = 1 AND (("posts"."author_id" = 1 AND "posts"."body" = 'Such a lovely day' OR "posts"."author_id" = 1 AND "posts"."type" = 'SpecialPost'))
2580
+  (0.0ms) rollback transaction
2581
+  (0.0ms) begin transaction
2582
+ Author Load (0.1ms) SELECT "authors".* FROM "authors" WHERE (NOT (("authors"."name" = 'David' OR "authors"."name" = 'Mary')))
2583
+  (0.0ms) rollback transaction
2584
+  (0.0ms) begin transaction
2585
+ Author Load (0.0ms) SELECT "authors".* FROM "authors" WHERE "authors"."name" = 'David' LIMIT 1
2586
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."author_id" = 1 AND (NOT (("posts"."author_id" = 1 AND "posts"."body" = 'Such a lovely day' OR "posts"."author_id" = 1 AND "posts"."type" = 'SpecialPost')))
2587
+  (0.0ms) rollback transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord_any_of
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier El Mekki