visual_condition_builder 2.2.5 → 2.2.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4596aae923f37f0628c5a4dd2197879b6a00260c
|
4
|
+
data.tar.gz: b9c1d36ecf19d852a39fd0f9f6f1756cbaec1449
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34035631b016918f186be5ed191f7c804dc8bd688e30b7c55941735787ed3d996dac0eae4cb1386330fd8719832e98dbdbb61d858a6a7136de170e3d52bf2c0d
|
7
|
+
data.tar.gz: 1ab163643a37a9ec31307d60930112de4afea8e3fc51a051986604f7a878a9bd20f6fd9d49c010cba0a02ccc4777905fe0e4add73067acad3795e6b219360bca
|
data/README.md
CHANGED
@@ -139,8 +139,9 @@ true | where a field is true | no_value: true, multiple: false
|
|
139
139
|
not_true | Opposite :true | no_value: true, multiple: false
|
140
140
|
false | where a field is false | no_value: true, multiple: false
|
141
141
|
not_false | Opposite :false | no_value: true, multiple: false
|
142
|
-
present | where a field is present
|
143
|
-
|
142
|
+
present | where a field is present | no_value: true, multiple: false
|
143
|
+
not_present | where a field is not present | no_value: true, multiple: false
|
144
|
+
blank | where a field is blank | no_value: true, multiple: false
|
144
145
|
null | where a field is null | no_value: true, multiple: false
|
145
146
|
not_null | Opposite :null | no_value: true, multiple: false
|
146
147
|
|
@@ -25,7 +25,8 @@ module VisualConditionBuilder
|
|
25
25
|
when :next_week
|
26
26
|
ransack_q["#{p[0]}_gteq"] = Date.today.next_week.beginning_of_week
|
27
27
|
ransack_q["#{p[0]}_lteq"] = Date.today.next_week.end_of_week
|
28
|
-
when :not_null, :null, :blank, :true, :not_true, :false, :not_false, :present
|
28
|
+
when :not_null, :null, :blank, :true, :not_true, :false, :not_false, :present, :not_present
|
29
|
+
#TODO: VALIDAR ESSES OPERADORES
|
29
30
|
ransack_q["#{p[0]}_#{p[1]}"] = '1'
|
30
31
|
else
|
31
32
|
ransack_q["#{p[0]}_#{p[1]}"] = p[2]
|
@@ -109,15 +110,17 @@ module VisualConditionBuilder
|
|
109
110
|
when :true
|
110
111
|
tmp[p[0]] = 'true'
|
111
112
|
when :not_true
|
112
|
-
tmp[p[0]] = Hash["$ne",
|
113
|
+
tmp[p[0]] = Hash["$ne", true]
|
113
114
|
when :false
|
114
115
|
tmp[p[0]] = 'false'
|
115
116
|
when :not_false
|
116
|
-
tmp[p[0]] = Hash["$ne",
|
117
|
+
tmp[p[0]] = Hash["$ne", false]
|
117
118
|
when :present
|
118
|
-
tmp[p[0]] = Hash["$
|
119
|
+
tmp[p[0]] = Hash["$exists", true]
|
120
|
+
when :not_present
|
121
|
+
tmp[p[0]] = Hash["$exists", false]
|
119
122
|
when :blank
|
120
|
-
tmp[p[0]] = ''
|
123
|
+
tmp[p[0]] = Hash["$in", ['null','']]
|
121
124
|
when :null
|
122
125
|
tmp[p[0]] = 'null'
|
123
126
|
when :not_null
|
@@ -63,15 +63,15 @@ module VisualConditionBuilder
|
|
63
63
|
type = type.present? ? normalized_name(type) : 'string'
|
64
64
|
operators = case type
|
65
65
|
when :date, :datetime
|
66
|
-
[:eq, :between, :today, :yesterday, :tomorrow, :this_week, :last_week, :next_week, :present, :blank]
|
66
|
+
[:eq, :between, :today, :yesterday, :tomorrow, :this_week, :last_week, :next_week, :present, :not_present, :blank]
|
67
67
|
when :time
|
68
|
-
[:eq, :between, :present, :blank]
|
68
|
+
[:eq, :between, :present, :not_present, :blank]
|
69
69
|
when :decimal, :integer
|
70
70
|
[:eq, :between]
|
71
71
|
when :boolean
|
72
|
-
[:true, :false, :present, :blank]
|
72
|
+
[:true, :false, :present, :not_present, :blank]
|
73
73
|
when :string
|
74
|
-
[:cont, :eq, :start, :end, :present, :blank]
|
74
|
+
[:cont, :not_cont, :eq, :not_eq, :start, :end, :present, :not_present, :blank]
|
75
75
|
else
|
76
76
|
[:eq]
|
77
77
|
end
|
@@ -135,6 +135,7 @@ module VisualConditionBuilder
|
|
135
135
|
not_false: {no_value: true, multiple: false},
|
136
136
|
|
137
137
|
present: {no_value: true, multiple: false},
|
138
|
+
not_present: {no_value: true, multiple: false},
|
138
139
|
blank: {no_value: true, multiple: false},
|
139
140
|
|
140
141
|
null: {no_value: true, multiple: false},
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: visual_condition_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno Porto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|