where-or 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/where-or.rb +9 -0
- metadata +26 -4
- metadata.gz.sig +1 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2f81ecc810527c811c55941f9f7bc23376dcd75
|
4
|
+
data.tar.gz: d5dfe157818c2e5f9cc451613a3939b2e5a39e43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe9affdef0fb817a152ab975f3d7de3b36fda610f0fe81f44f457574113cdfabfe2d1b19a1be3c97a2b4f6936964291b2c3d7a02aa4d9a48acd4101c6a9c648c
|
7
|
+
data.tar.gz: 9cc489658e4bd70ee4463cd2d193bdd66d0334e8bf2d89131b78c82a2f1d931849332b160a6737acbbc2a4bef93bd269cef0373b3f01b8ba22d83f284dceabc8
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
ADDED
Binary file
|
data/lib/where-or.rb
CHANGED
@@ -127,6 +127,15 @@ ActiveSupport.on_load(:active_record) do
|
|
127
127
|
)
|
128
128
|
end
|
129
129
|
|
130
|
+
# monkey patching around the fact that the rails 4.2 implementation is an array of things, all 'and'd together
|
131
|
+
# but the rails 5 implemention that they backported replaces that array with ActiveRecord::Relation::WhereClause that
|
132
|
+
# contains AND's and OR's ... on testing, I discover it mostly works except when you attempt to use the preloader,
|
133
|
+
# which this hack here fixes.
|
134
|
+
def -(other)
|
135
|
+
raise "where-or internal error: expect only empty array, not #{other.inspect}" unless other.empty? || (other.size == 1 && other.first.blank?)
|
136
|
+
[self]
|
137
|
+
end
|
138
|
+
|
130
139
|
def merge(other)
|
131
140
|
ActiveRecord::Relation::WhereClause.new(
|
132
141
|
predicates_unreferenced_by(other) + other.predicates,
|
metadata
CHANGED
@@ -1,15 +1,37 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Fleischer
|
8
8
|
- Eric Guo
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
|
-
cert_chain:
|
12
|
-
|
11
|
+
cert_chain:
|
12
|
+
- |
|
13
|
+
-----BEGIN CERTIFICATE-----
|
14
|
+
MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBBMRMwEQYDVQQDDAplcmlj
|
15
|
+
Lmd1b2N6MRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZFgNj
|
16
|
+
b20wHhcNMTYwNzExMTUyMTU2WhcNMTcwNzExMTUyMTU2WjBBMRMwEQYDVQQDDApl
|
17
|
+
cmljLmd1b2N6MRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZ
|
18
|
+
FgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6LSiHb79c6Krm
|
19
|
+
TeoHq5fko/QJownbKLtlzHmWCGb6B38mIPqYZBSmfaK9EZr6DTf7TJWB7e/u2+Ep
|
20
|
+
bXCqdUxRDbQZig52DvKfljfgOD/YzALHKAckuk/sskvM2pdtRIowJSYAG/Hz2j1d
|
21
|
+
mngRZaIDd/09CNttRsgCDXZl+qqsNJKCQWZ3T8OdqmlpwkIxo7llKEQ578fQwgZ3
|
22
|
+
8uE4RLMv8fOdFv0EzGXbRyFLCT2WEAH5Ns2Jv12KKbvYCTICdJ36cSV8hOUZT0fG
|
23
|
+
y4FxEXtV9uJVJv3BJ5LE84TWdNiMI1lbFul72p09vebUe2N0Hru3XDnfq69XJ+9e
|
24
|
+
nZC9MFk/AgMBAAGjezB5MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
|
25
|
+
BBR/fjIribDcJvWvxPh+zv2kFGRAejAfBgNVHREEGDAWgRRlcmljLmd1b2N6QGdt
|
26
|
+
YWlsLmNvbTAfBgNVHRIEGDAWgRRlcmljLmd1b2N6QGdtYWlsLmNvbTANBgkqhkiG
|
27
|
+
9w0BAQUFAAOCAQEAIA++aoEJOSbTwQml1cQ+z2psV2R18HKYR7ZM8bGEm9PxGyLt
|
28
|
+
DcpqGIL65VctVjqVzD4RTvDrsFhVICL5o0rLYpC4Qm5jBpx+E2s/akJSDsQcOO12
|
29
|
+
qk+IDlQHJjhf7DOg0+XAIj1/QTvq8s3QrrD8NRoIvGcAXVzqAafcG9NOGIXpqFS1
|
30
|
+
ZdwgixrYZK4p/Z+qIJFiuGvBauegUn0x7WDln52cWXgb+a/oYPBjGtBAZznhSy+R
|
31
|
+
R5k6Ma92sW8jupX4cqbSu9rntdVQkNRpoHIrfU0MZT0cKsg/D1zMteylxrO3KMsz
|
32
|
+
SPQRv+nrI1J0zevFqb8010heoR8SDyUA0Mm3+Q==
|
33
|
+
-----END CERTIFICATE-----
|
34
|
+
date: 2016-11-11 00:00:00.000000000 Z
|
13
35
|
dependencies:
|
14
36
|
- !ruby/object:Gem::Dependency
|
15
37
|
name: rails
|
@@ -62,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
84
|
version: '0'
|
63
85
|
requirements: []
|
64
86
|
rubyforge_project:
|
65
|
-
rubygems_version: 2.6.
|
87
|
+
rubygems_version: 2.6.8
|
66
88
|
signing_key:
|
67
89
|
specification_version: 4
|
68
90
|
summary: Where or function backport from Rails 5 for Rails 4.2
|
metadata.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
����ZK�!��/�Q��2�$�H=�9�%ޞ8�'c�d,������L�����6S���(���%�I�����!�z������18�@�+���b/�"��*�<���)�@z�'�ϡ�A��p�"����r7f.�.��Á���}��A�;j�!�1��Ud�+@o�S+�d���FB[-S����(-3]i�-��,�>cKE�S�@U$�=���0����E`�E<���f������t�0f�vU
|