arel_extensions 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arel_extensions/predications.rb +7 -7
- data/lib/arel_extensions/version.rb +1 -1
- data/test/with_ar/all_agnostic_test.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 609562660b01b52ccd184d516350279bd561e0a6
|
4
|
+
data.tar.gz: 8d27e16f757f07669329be3c7cf517fd97c3d29b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 321e17886db0f209b2d0fe76d9d46c5999285a1f751738457c4ce10a63c3a040dc069d02166f8d6355cba2113832a9545b5a0384c9d62a55194a5307e3d3ce9f
|
7
|
+
data.tar.gz: e856b02e9d6ba606ad727780fc8d50cdc6af8fb33655647379ab9595d1f2997ef52aff6c5cd5c3c567f51015ea6753cfca2818344938532bb4ca8275947ec64f
|
@@ -30,10 +30,10 @@ module ArelExtensions
|
|
30
30
|
when 1
|
31
31
|
res = self.is_null.or(self==other[0])
|
32
32
|
else
|
33
|
-
res = self.is_null.or(Arel::Nodes::In.new(self,other
|
33
|
+
res = self.is_null.or(Arel::Nodes::In.new(self,quoted_array(other)))
|
34
34
|
end
|
35
35
|
else
|
36
|
-
res = Arel::Nodes::In.new(self,other
|
36
|
+
res = Arel::Nodes::In.new(self,quoted_array(other))
|
37
37
|
end
|
38
38
|
when nil
|
39
39
|
res = self.is_null
|
@@ -42,9 +42,9 @@ module ArelExtensions
|
|
42
42
|
when Range
|
43
43
|
res = self.between(other)
|
44
44
|
else
|
45
|
-
res = Arel::Nodes::In.new(self,
|
45
|
+
res = Arel::Nodes::In.new(self,quoted_node(other))
|
46
46
|
end
|
47
|
-
res
|
47
|
+
res
|
48
48
|
end
|
49
49
|
|
50
50
|
def not_in(other) #In should handle nil element in the Array
|
@@ -59,17 +59,17 @@ module ArelExtensions
|
|
59
59
|
when 1
|
60
60
|
res = self.is_not_null.and(self!=other[0])
|
61
61
|
else
|
62
|
-
res = self.is_not_null.and(Arel::Nodes::NotIn.new(self,other
|
62
|
+
res = self.is_not_null.and(Arel::Nodes::NotIn.new(self,quoted_array(other)))
|
63
63
|
end
|
64
64
|
else
|
65
|
-
res = Arel::Nodes::NotIn.new(self,other
|
65
|
+
res = Arel::Nodes::NotIn.new(self,quoted_array(other))
|
66
66
|
end
|
67
67
|
when nil
|
68
68
|
res = self.is_not_null
|
69
69
|
when Arel::SelectManager
|
70
70
|
res = Arel::Nodes::NotIn.new(self, other.ast)
|
71
71
|
else
|
72
|
-
res = Arel::Nodes::NotIn.new(self,
|
72
|
+
res = Arel::Nodes::NotIn.new(self,quoted_node(other))
|
73
73
|
end
|
74
74
|
res
|
75
75
|
end
|
@@ -595,6 +595,16 @@ module ArelExtensions
|
|
595
595
|
assert_equal false , @test.where(@age.in([nil,1,2])).blank?
|
596
596
|
end
|
597
597
|
|
598
|
+
def test_scope_with_in_plus_new
|
599
|
+
begin
|
600
|
+
@test.where(@age.in([1,2])).new
|
601
|
+
@test.where(@age.not_in([1,2])).new
|
602
|
+
assert true
|
603
|
+
rescue
|
604
|
+
assert false
|
605
|
+
end
|
606
|
+
end
|
607
|
+
|
598
608
|
def test_is_not_null
|
599
609
|
assert_equal false , @myung.where(@age.is_not_null).blank?
|
600
610
|
assert_equal true , @test.where(@age.is_not_null).blank?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arel_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yann Azoury
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-06-
|
13
|
+
date: 2018-06-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: arel
|