active_flags 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/active_flags/handler/flag_builder.rb +5 -4
- 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: 38b1db29753a873e71a1b3146605bbe36f5ba1c66e411be44367f5971b5a1eba
|
4
|
+
data.tar.gz: 0245ea51df381b0497f482356c4a81788c6e9ca02a1d3c859c55bc9e28fa2417
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4acd21ebfcee4c8ac6ccd1550d6442933e4bfe920aad899cebddcb6888d080f5f4ad029afbaa32914861caaca941e20311587dde143aa21a658d93c206825ebd
|
7
|
+
data.tar.gz: 71894e8a717786a27fc3143ec70de063c7ee07b1b6eb5d2eb5b4c45e3a20bcf358bec8cef8b9b76972d95630ee20671977e65e97f54e292c70c73a1fda9b1b76
|
data/README.md
CHANGED
@@ -76,7 +76,7 @@ user.update!(flags: { visible: true, active: true, diet: 'vegan', power: 'super
|
|
76
76
|
To access your flags, you now have 2 ways.
|
77
77
|
Either as a hash, with the `flags` method or as an ActiveFlag::Flags collection with the `flags_as_collection` method.
|
78
78
|
|
79
|
-
##
|
79
|
+
## Flags as scopes
|
80
80
|
|
81
81
|
When you develop an app without active_flags, you will generally query the equivalent of flags as simple booleans.
|
82
82
|
|
@@ -118,4 +118,4 @@ User.not_flagged_as_intelligent('a bit')
|
|
118
118
|
https://github.com/FidMe/active_flags
|
119
119
|
|
120
120
|
## License
|
121
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
121
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -7,10 +7,11 @@ module ActiveFlags
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def save
|
10
|
-
ActiveFlags::Flag.find_or_initialize_by(subject: @resource, key: @flag_attributes[:key])
|
11
|
-
|
12
|
-
|
10
|
+
flag = ActiveFlags::Flag.find_or_initialize_by(subject: @resource, key: @flag_attributes[:key])
|
11
|
+
flag.update!(value: @flag_attributes[:value])
|
12
|
+
|
13
|
+
@resource.flags_as_collection << flag
|
13
14
|
end
|
14
15
|
end
|
15
16
|
end
|
16
|
-
end
|
17
|
+
end
|
data/lib/active_flags/version.rb
CHANGED