default_where 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/default_where.rb +3 -3
- data/lib/default_where/version.rb +1 -1
- metadata +14 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 415c588b05d60281fb9ce000d231a468ff9bf924f08a91a0d5ab062f4b8c03db
|
4
|
+
data.tar.gz: 2663281cf4596d7a59eda6dd0866d589580d38f2a2c3bd547a815800041b8560
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a7456d42265499ebef6ab5df439539e0d6f4c2baae493fdfda5232112a09a1ba67a56c60a0103b44f1643741f576b11510f94e07c34c8f62a83b1c57657b86f
|
7
|
+
data.tar.gz: 00f9cee62150cefeedc252988d49cd81cd5aea77507e531e6c7c88930d1a95d27d0ce6283ec46c84884c4d4afaa3f10fdf96677c645ec684670456fec0198775
|
data/lib/default_where.rb
CHANGED
@@ -9,7 +9,7 @@ module DefaultWhere
|
|
9
9
|
include DefaultWhere::Order
|
10
10
|
include DefaultWhere::Like
|
11
11
|
|
12
|
-
REJECT = ['',
|
12
|
+
REJECT = ['', nil]
|
13
13
|
STRIP = true
|
14
14
|
|
15
15
|
def default_where(params = {}, options = {})
|
@@ -32,9 +32,9 @@ module DefaultWhere
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def params_with_table(params = {}, options = {})
|
35
|
-
if options
|
35
|
+
if options.has_key?(:reject)
|
36
36
|
default_reject = [options[:reject]].flatten
|
37
|
-
elsif options
|
37
|
+
elsif options.has_key?(:allow)
|
38
38
|
default_reject = REJECT - [options[:allow]].flatten
|
39
39
|
else
|
40
40
|
default_reject = REJECT
|
metadata
CHANGED
@@ -1,55 +1,61 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: default_where
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- qinmingyuan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.0'
|
17
20
|
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.0
|
22
|
+
version: '4.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '5.0'
|
24
30
|
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.0
|
32
|
+
version: '4.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rdoc
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- - "
|
37
|
+
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
39
|
version: '0'
|
34
40
|
type: :development
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
|
-
- - "
|
44
|
+
- - "~>"
|
39
45
|
- !ruby/object:Gem::Version
|
40
46
|
version: '0'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: rake
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
|
-
- - "
|
51
|
+
- - "~>"
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: '0'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
|
-
- - "
|
58
|
+
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
60
|
version: '0'
|
55
61
|
description: Description of QueryScope.
|