bitwise_attribute 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +19 -20
- data/lib/bitwise_attribute/active_record_methods.rb +12 -12
- data/lib/bitwise_attribute/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df49609ab57b88fb77568ae2cdc29ee9851626a67e632170e9a90ebae1bbbfdb
|
4
|
+
data.tar.gz: c5271b2e9ef62d0a6e1e1e55bddc3eaa63274d775065618077fe78299774fcae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64de0ef4cef8fcec575b2c31e04350282c0b5c45c87d2ef87e2a174c13f80cbb2bbafe06e273c189ace9650123b1e4d7f5ff9bd999c1086d2866dbea06bd409f
|
7
|
+
data.tar.gz: bf54560552fdfbf62753044fe65507c405d81240733317e6200cf0417347161aa618cfeddf347d689bdf233917109c5e1d9a51d651c1f32eddd52668a1ea796c
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bitwise_attribute (0.3.
|
4
|
+
bitwise_attribute (0.3.5)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
activemodel (6.1.
|
10
|
-
activesupport (= 6.1.
|
11
|
-
activerecord (6.1.
|
12
|
-
activemodel (= 6.1.
|
13
|
-
activesupport (= 6.1.
|
14
|
-
activesupport (6.1.
|
9
|
+
activemodel (6.1.4.1)
|
10
|
+
activesupport (= 6.1.4.1)
|
11
|
+
activerecord (6.1.4.1)
|
12
|
+
activemodel (= 6.1.4.1)
|
13
|
+
activesupport (= 6.1.4.1)
|
14
|
+
activesupport (6.1.4.1)
|
15
15
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
16
|
i18n (>= 1.6, < 2)
|
17
17
|
minitest (>= 5.1)
|
@@ -20,16 +20,16 @@ GEM
|
|
20
20
|
ast (2.4.2)
|
21
21
|
byebug (11.1.3)
|
22
22
|
coderay (1.1.3)
|
23
|
-
concurrent-ruby (1.1.
|
23
|
+
concurrent-ruby (1.1.9)
|
24
24
|
diff-lcs (1.4.4)
|
25
25
|
docile (1.4.0)
|
26
|
-
ffi (1.15.
|
26
|
+
ffi (1.15.4-java)
|
27
27
|
i18n (1.8.10)
|
28
28
|
concurrent-ruby (~> 1.0)
|
29
29
|
method_source (1.0.0)
|
30
30
|
minitest (5.14.4)
|
31
|
-
parallel (1.
|
32
|
-
parser (3.0.
|
31
|
+
parallel (1.21.0)
|
32
|
+
parser (3.0.2.0)
|
33
33
|
ast (~> 2.4.1)
|
34
34
|
pry (0.13.1)
|
35
35
|
coderay (~> 1.1)
|
@@ -42,7 +42,7 @@ GEM
|
|
42
42
|
byebug (~> 11.0)
|
43
43
|
pry (~> 0.13.0)
|
44
44
|
rainbow (3.0.0)
|
45
|
-
rake (13.0.
|
45
|
+
rake (13.0.6)
|
46
46
|
regexp_parser (2.1.1)
|
47
47
|
rexml (3.2.5)
|
48
48
|
rspec (3.10.0)
|
@@ -58,22 +58,21 @@ GEM
|
|
58
58
|
diff-lcs (>= 1.2.0, < 2.0)
|
59
59
|
rspec-support (~> 3.10.0)
|
60
60
|
rspec-support (3.10.2)
|
61
|
-
rubocop (1.
|
61
|
+
rubocop (1.22.1)
|
62
62
|
parallel (~> 1.10)
|
63
63
|
parser (>= 3.0.0.0)
|
64
64
|
rainbow (>= 2.2.2, < 4.0)
|
65
65
|
regexp_parser (>= 1.8, < 3.0)
|
66
66
|
rexml
|
67
|
-
rubocop-ast (>= 1.
|
67
|
+
rubocop-ast (>= 1.12.0, < 2.0)
|
68
68
|
ruby-progressbar (~> 1.7)
|
69
69
|
unicode-display_width (>= 1.4.0, < 3.0)
|
70
|
-
rubocop-ast (1.
|
70
|
+
rubocop-ast (1.12.0)
|
71
71
|
parser (>= 3.0.1.1)
|
72
|
-
rubocop-rake (0.
|
73
|
-
rubocop
|
74
|
-
rubocop-rspec (2.3.0)
|
72
|
+
rubocop-rake (0.6.0)
|
75
73
|
rubocop (~> 1.0)
|
76
|
-
|
74
|
+
rubocop-rspec (2.5.0)
|
75
|
+
rubocop (~> 1.19)
|
77
76
|
ruby-progressbar (1.11.0)
|
78
77
|
simplecov (0.21.2)
|
79
78
|
docile (~> 1.1)
|
@@ -86,7 +85,7 @@ GEM
|
|
86
85
|
sqlite3 (1.4.2)
|
87
86
|
tzinfo (2.0.4)
|
88
87
|
concurrent-ruby (~> 1.0)
|
89
|
-
unicode-display_width (2.
|
88
|
+
unicode-display_width (2.1.0)
|
90
89
|
zeitwerk (2.4.2)
|
91
90
|
|
92
91
|
PLATFORMS
|
@@ -6,12 +6,12 @@ module BitwiseAttribute
|
|
6
6
|
define_singleton_method("with_#{name}") do |*keys|
|
7
7
|
keys = cleanup_keys(keys, mapping)
|
8
8
|
|
9
|
-
return
|
9
|
+
return none unless keys&.any?
|
10
10
|
|
11
|
-
records =
|
11
|
+
records = all
|
12
12
|
|
13
|
-
keys
|
14
|
-
records = records.where(
|
13
|
+
keys.each do |key|
|
14
|
+
records = records.where((arel_table[column_name] & mapping[key]).eq(mapping[key]))
|
15
15
|
end
|
16
16
|
|
17
17
|
records
|
@@ -22,10 +22,10 @@ module BitwiseAttribute
|
|
22
22
|
|
23
23
|
return where.not(column_name => nil) unless keys&.any?
|
24
24
|
|
25
|
-
records = where(
|
25
|
+
records = where('1=0')
|
26
26
|
|
27
|
-
keys
|
28
|
-
records = records.or(where(
|
27
|
+
keys.each do |key|
|
28
|
+
records = records.or(where((arel_table[column_name] & mapping[key]).eq(mapping[key])))
|
29
29
|
end
|
30
30
|
|
31
31
|
records
|
@@ -34,12 +34,12 @@ module BitwiseAttribute
|
|
34
34
|
define_singleton_method("with_exact_#{name}") do |*keys|
|
35
35
|
keys = cleanup_keys(keys, mapping)
|
36
36
|
|
37
|
-
return
|
37
|
+
return none unless keys&.any?
|
38
38
|
|
39
39
|
records = send("with_#{name}", keys)
|
40
40
|
|
41
41
|
(mapping.keys - keys).each do |key|
|
42
|
-
records = records.where(
|
42
|
+
records = records.where((arel_table[column_name] & mapping[key]).not_eq(mapping[key]))
|
43
43
|
end
|
44
44
|
|
45
45
|
records
|
@@ -50,10 +50,10 @@ module BitwiseAttribute
|
|
50
50
|
|
51
51
|
return where(column_name => nil).or(where(column_name => 0)) unless keys&.any?
|
52
52
|
|
53
|
-
records =
|
53
|
+
records = all
|
54
54
|
|
55
|
-
keys
|
56
|
-
records = records.where(
|
55
|
+
keys.each do |key|
|
56
|
+
records = records.where((arel_table[column_name] & mapping[key]).not_eq(mapping[key]))
|
57
57
|
end
|
58
58
|
|
59
59
|
records
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitwise_attribute
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Otero
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|