where-or 0.1.1 → 0.1.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 +4 -4
- data/README.md +1 -1
- data/lib/where-or.rb +12 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a8bfccbdf3bdfea44c956cf6d044c2a5ad2da00
|
4
|
+
data.tar.gz: 0645fe9531ecea43d7a1538ea4d42a95ca5864a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1b550c7fd8219a42159273af1c65426da3bdde824faf1e56d875e79f6f0e13add2ae4f013c3f994aa4ceaa65a76efdd3e13f98b03b7682b1e965ab031caa77d
|
7
|
+
data.tar.gz: 172daeacff899edaabf660b6c8cd64322581bc21fc543b176e7cb5adf88f091819ee5c0f6d6a377b48f141b97f7e06bcb4b493aaf5ab25f42dd0322310d522ab
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[Where or](https://github.com/rails/rails/pull/16052) function backport from Rails 5 for Rails 4.2
|
4
4
|
|
5
|
-
Confirm works from Rails 4.2.3 to 4.2.
|
5
|
+
Confirm works from Rails 4.2.3 to 4.2.6, including for preloading
|
6
6
|
|
7
7
|
[](https://badge.fury.io/for/rb/where-or)
|
8
8
|
|
data/lib/where-or.rb
CHANGED
@@ -86,7 +86,7 @@ ActiveSupport.on_load(:active_record) do
|
|
86
86
|
|
87
87
|
private def structurally_compatible_for_or?(other) # :nodoc:
|
88
88
|
(ActiveRecord::Relation::SINGLE_VALUE_METHODS - [:from]).all? { |m| send("#{m}_value") == other.send("#{m}_value") } &&
|
89
|
-
(ActiveRecord::Relation::MULTI_VALUE_METHODS - [:extending, :where, :having, :bind]).all? { |m| send("#{m}_values") == other.send("#{m}_values") }
|
89
|
+
(ActiveRecord::Relation::MULTI_VALUE_METHODS - [:references, :eager_load, :extending, :where, :having, :bind]).all? { |m| send("#{m}_values") == other.send("#{m}_values") }
|
90
90
|
# https://github.com/rails/rails/commit/2c46d6db4feaf4284415f2fb6ceceb1bb535f278
|
91
91
|
# https://github.com/rails/rails/commit/39f2c3b3ea6fac371e79c284494e3d4cfdc1e929
|
92
92
|
# https://github.com/rails/rails/commit/bdc5141652770fd227455681cde1f9899f55b0b9
|
@@ -270,4 +270,15 @@ ActiveSupport.on_load(:active_record) do
|
|
270
270
|
end
|
271
271
|
|
272
272
|
end
|
273
|
+
|
274
|
+
class Arel::Visitors::Visitor
|
275
|
+
def visit_ActiveRecord_Relation_WhereClause o, collector
|
276
|
+
if o.binds
|
277
|
+
visit_Arel_Nodes_And(o.ast, collector)
|
278
|
+
else
|
279
|
+
collector << '1=1' # no-op
|
280
|
+
collector
|
281
|
+
end
|
282
|
+
end
|
283
|
+
end
|
273
284
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: where-or
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Fleischer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-06-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
62
|
version: '0'
|
63
63
|
requirements: []
|
64
64
|
rubyforge_project:
|
65
|
-
rubygems_version: 2.4
|
65
|
+
rubygems_version: 2.6.4
|
66
66
|
signing_key:
|
67
67
|
specification_version: 4
|
68
68
|
summary: Where or function backport from Rails 5 for Rails 4.2
|