bitfields 0.12.1 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.md +1 -0
- data/lib/bitfields.rb +3 -5
- data/lib/bitfields/version.rb +1 -1
- 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: fa18acfa732a68288db8c56fc05ccfae55530be9
|
4
|
+
data.tar.gz: 1a23e528932a1e8d1873ec8ec9a707a6c3dc000d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c14625d4af510f6789978ad7b872cb4b300e08efeb8af4d03b235086afb5dcce677f03a242f051987011f9b38750416b6e1fd00d934ba9a538acd97c275ae7c
|
7
|
+
data.tar.gz: b7f9579b08062e2e140272f8942c4a659a9a22e2610d3987df6211c4b0c37d2d10cc469c2de56cdc6d99ef8eeb078e70ca013d967adb5518b2e3caa9de3c118f
|
data/Readme.md
CHANGED
@@ -154,6 +154,7 @@ Authors
|
|
154
154
|
- [Alan Wong](https://github.com/naganowl)
|
155
155
|
- [Andrew Bates](https://github.com/a-bates)
|
156
156
|
- [Shirish Pampoorickal](https://github.com/shirish-pampoorickal)
|
157
|
+
- [Sergey Kojin](https://github.com/skojin)
|
157
158
|
|
158
159
|
[Michael Grosser](http://grosser.it)<br/>
|
159
160
|
michael@grosser.it<br/>
|
data/lib/bitfields.rb
CHANGED
@@ -140,12 +140,10 @@ module Bitfields
|
|
140
140
|
on, off = bit_values_to_on_off(column, bit_values)
|
141
141
|
"(#{table_name}.#{column} & #{on+off}) = #{on}"
|
142
142
|
when :bit_operator_or
|
143
|
+
on, off = bit_values_to_on_off(column, bit_values)
|
143
144
|
result = []
|
144
|
-
|
145
|
-
|
146
|
-
eql = value ? bit : 0
|
147
|
-
result << "(#{table_name}.#{column} & #{bit}) = #{eql}"
|
148
|
-
end
|
145
|
+
result << "(#{table_name}.#{column} & #{on}) <> 0" if on != 0
|
146
|
+
result << "(#{table_name}.#{column} & #{off}) <> #{off}" if off != 0
|
149
147
|
result.join(' OR ')
|
150
148
|
else raise("bitfields: unknown query mode #{mode.inspect}")
|
151
149
|
end
|
data/lib/bitfields/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitfields
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|