active_flags 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_flags.rb +5 -2
- data/lib/active_flags/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e7a7ae6d57b7d260e5544dba935de74fe2f8a4bcd8559c3479eb19bd8daa13d
|
4
|
+
data.tar.gz: f3b8b5e4a0a20cf9b9b860dc82bb6e145f7432d273fa757ae211d38745db67d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d93513fae1dce7c4bcf8fe483ddf5c3092abd870144207be8394cee0fedbb4bd1568d898bc0c275c6d22c3924d09e946ebe2806f6c8708b679438647038e9cfd
|
7
|
+
data.tar.gz: 19de22753247e3fdfd7482171871f115b20784a4d84b6fdbeb32a2ee8cddb76d873de1f4cb2e20e18d49feaca52aa52fcd31141bab4a1c034027304ed43a758d
|
data/lib/active_flags.rb
CHANGED
@@ -25,8 +25,11 @@ module ActiveFlags
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
private
|
29
|
+
|
30
|
+
def method_missing(method_name, *args, &block)
|
31
|
+
return super unless method_name.to_s.include?(prefix = 'flagged_as_')
|
32
|
+
|
30
33
|
different_from = method_name.to_s.starts_with?('not')
|
31
34
|
flag = method_name.to_s.gsub(different_from ? "not_#{prefix}" : prefix, '')
|
32
35
|
condition = { active_flags_flags: { value: stringify(args[0]) } }
|
data/lib/active_flags/version.rb
CHANGED