activemodel_flags 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7dca83b9ff5623785e8b7192d6269fcf66262c0e
4
- data.tar.gz: dea2ba65e6d0df5b0fbc42a0f317db2eefc3ca0b
3
+ metadata.gz: d1e1bded5e5954620eb9b8f3ffb1e383eda9f22a
4
+ data.tar.gz: fcfb03822648efd517a2d0094700b746c937d528
5
5
  SHA512:
6
- metadata.gz: e405eec9189bb6139e1f36142a1aef77b0fbfc1330976a6d40ecbacc7545868205623786878d8631bf81e3a029f3bd539e3b3652723793a913bd2213fd3b42a0
7
- data.tar.gz: 776a5f3bccbcd70d71121cbd2bd7d1eeeb4a719434cc1a6ce62fbc41a705c132e8fda4a22bb457d2beae2783cb8f28dc7d464beb182e1af759f39f152825642e
6
+ metadata.gz: 6ee4140d324b8cbd4d5c3696995e4f0ac942ed8ba2d966f91d5a00b40dbd354ee55359bbca3ca1521cfacea9ae1ce40d8f4a37d979af039f2d4e3ae4390b52f9
7
+ data.tar.gz: 503dc08d6f6a6b50fb50929356d2015d9a59c235fd75114f3575a64ba8b0bfb16c5c454aeb344606fecbcfc01a515955a5030d6790adee0c8a5c657ea13131f0
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  The Active Model Flags Gem lets you attach the `has_flags` trait to your User, Account, or any other rails active models.
6
6
 
7
7
  ## Why would you need a flags attribute and this gem?
8
- For some applications you don't want ot add a million different attributes in your database for flags that are potentially one-time events. For example, if you wanted to track whether a user has been notified of something, or has been sent an email. These arbitrary flag columns start to clutter your DB.
8
+ For some applications you don't want to add a million different attributes in your database for flags that are potentially one-time events. For example, if you wanted to track whether a user has been notified of something, or has been sent an email. These arbitrary flag columns start to clutter your DB.
9
9
 
10
10
  The Active Model Flags gem solves this issue by allowing you to arbitrarily set and get flags from a serialized column.
11
11
 
@@ -71,6 +71,7 @@ module ActivemodelFlags
71
71
 
72
72
  #### getters
73
73
  def has_flag?(flag)
74
+ return false if self.flags.blank?
74
75
  self.flags[flag.to_s] != nil
75
76
  end
76
77
  def has?(flag)
@@ -1,3 +1,3 @@
1
1
  module ActivemodelFlags
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemodel_flags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay El-Kaake
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-05 00:00:00.000000000 Z
11
+ date: 2016-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails