bitfield_flags 0.0.1 → 1.0.0

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: 99a10ba4ce6af537dbb923bf0362d059072a819f
4
- data.tar.gz: 55ef1f03055c092eef4adb19058db3b68c811a86
3
+ metadata.gz: aed4be5b9a0324c485226d8e00cd4ae94510aa5b
4
+ data.tar.gz: 5c752b14bca5268ec03effa621a7a1b923fe58b7
5
5
  SHA512:
6
- metadata.gz: 1437be27533d30b3349512248038dce9427fdddd9cb5471f1cccd7ebe55876b9d77114619e3e3a56f6c058a77b67ef06e0e24c03a540b2563199edc9a312ed52
7
- data.tar.gz: cec623dc95b96aea24d8d02eeb5d2c2301d074944990f9f79c0248ee123577ca3d5fc5e55f66d0329992c764bcc480f1921d03a402a425f17995a9628eea6a83
6
+ metadata.gz: c49b7eef7cfd603d126af4be177f57eaee60ae8f1ccb9873d4b3028cacd3d556223a848bc95adea056bbdd2cd9c8054b1d032eb4c65676acb5463fb6afb5f65a
7
+ data.tar.gz: 7dc926a8d4e1643d1fa95857e40caafafd1fffb496567e57bb675548933b05e05bed62019f01fc87c78ab18215c4d5ed19443ed13c6e2237d2579fa52ef9d4fd
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # BitfieldFlags
2
2
 
3
- TODO: Write a gem description
3
+ Quickly add bitfield scopes to an active record model
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,7 +18,24 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ ```ruby
22
+ class User < ActiveRecord::Base
23
+ include BitfieldFlags
24
+
25
+ scoped_flags %w(
26
+ is_admin
27
+ is_customer_service
28
+ legacy_user
29
+ )
30
+
31
+ # ...snip...
32
+ end
33
+
34
+ User.is_admin #=> Returns all users with the 'is_admin' bitfield turned on
35
+
36
+ user = User.first
37
+ user.is_admin? #=> true or false depending on the is_admin bitfield state
38
+ ```
22
39
 
23
40
  ## Contributing
24
41
 
@@ -1,3 +1,3 @@
1
1
  module BitfieldFlags
2
- VERSION = "0.0.1"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitfield_flags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carl Furrow