ft_gem 3.1.5 → 3.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ft_gem/controllers/helpers.rb +8 -2
- 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: 5ca0566dc7734cac585efc11741f71fdd293e4a924d207d0285d0555d4c63f34
|
4
|
+
data.tar.gz: d88568950bac57aa06858fa31dc5b18f32179d938cf79c2f08045894984a3230
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 530936aef0568a373e8b59aba62ff94bbb11593ea3b6c96ac7a860fa4351f0d578a4fe439df584ccf8c61bbce872aa42df0233eb3e7cb377542ceb6bcea9171b
|
7
|
+
data.tar.gz: 21a2c60a25d65c333fda8ed4cfe7eb6ea616cfd8490e9ff5acd46893f31adb0b6efc4f26b49e3afa79c4f01fdfe57d3737b31965c327b8c57457c070d4c1135c
|
@@ -14,8 +14,8 @@ module FtGem
|
|
14
14
|
client_percentage = calc_client_percentage(decoded_cookie: decoded_cookie, toggle_name: name)
|
15
15
|
toggle_percentage = toggles[index.to_i]['attributes']['percentage']
|
16
16
|
whitelisted = FtShared.new.whitelisted?(url: url, whitelist_urls: toggles[index.to_i]['attributes']['whitelist-urls'])
|
17
|
-
if user_id
|
18
|
-
return true
|
17
|
+
if user_id_beta(user_id: user_id)
|
18
|
+
return true && whitelisted
|
19
19
|
else
|
20
20
|
return client_percentage.to_i <= toggle_percentage.to_i && whitelisted
|
21
21
|
end
|
@@ -53,6 +53,12 @@ module FtGem
|
|
53
53
|
def api_feature_toggle_status(name:)
|
54
54
|
FtGem::View::Helpers.status(name: name)
|
55
55
|
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def user_id_beta(user_id: nil)
|
60
|
+
user_id.present? && toggles[index.to_i]['attributes']['status'] == "amber" && toggles[index.to_i]['attributes']['beta-users'].split(",").include?(user_id.to_s)
|
61
|
+
end
|
56
62
|
end
|
57
63
|
end
|
58
64
|
end
|