arel_extensions 1.0.7 → 1.0.8

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: 7e6925dda8ff2e84e0501da7f283326b69feb5ad
4
- data.tar.gz: 8935f5b0b37b38c8bfa63f5858eea8fc00fbe389
3
+ metadata.gz: 609562660b01b52ccd184d516350279bd561e0a6
4
+ data.tar.gz: 8d27e16f757f07669329be3c7cf517fd97c3d29b
5
5
  SHA512:
6
- metadata.gz: e14c35a07d01adce7aec5b79a5b0e063262cdb4ae35c6684d45ab334ea19fd988790eb158a539fe25d9f6801562295fbb80afc3e630fadf0cd3af58debd08e66
7
- data.tar.gz: a81609fa1c9281814271fa5d3fcebf269c08818e60c67c89b550d9072e0196f5606e1cadd3cb8465ab82899b9bec6a4878713b66a01ab62c4015a74c7bfaa58d
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.map{|e| convert_to_node(e)}))
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.map{|e| convert_to_node(e)})
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,convert_to_node(other))
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.map{|e| convert_to_node(e)}))
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.map{|e| convert_to_node(e)})
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,convert_to_node(other))
72
+ res = Arel::Nodes::NotIn.new(self,quoted_node(other))
73
73
  end
74
74
  res
75
75
  end
@@ -1,3 +1,3 @@
1
1
  module ArelExtensions
2
- VERSION = "1.0.7".freeze
2
+ VERSION = "1.0.8".freeze
3
3
  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.7
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-08 00:00:00.000000000 Z
13
+ date: 2018-06-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: arel