lib/rollout.rb in rollout-2.2.3 vs lib/rollout.rb in rollout-2.2.4
- old
+ new
@@ -57,10 +57,14 @@
else
@percentage == 100
end
end
+ def user_in_active_users?(user)
+ @users.include?(user_id(user))
+ end
+
def to_hash
{
percentage: @percentage,
groups: @groups,
users: @users
@@ -90,14 +94,10 @@
else
user_id(user)
end
end
- def user_in_active_users?(user)
- @users.include?(user_id(user))
- end
-
def user_in_active_group?(user, rollout)
@groups.any? do |g|
rollout.active_in_group?(g, user)
end
end
@@ -181,11 +181,16 @@
def active?(feature, user = nil)
feature = get(feature)
feature.active?(self, user)
end
+ def user_in_active_users?(feature, user = nil)
+ feature = get(feature)
+ feature.user_in_active_users?(user)
+ end
+
def inactive?(feature, user = nil)
- !active(feature, user)
+ !active?(feature, user)
end
def activate_percentage(feature, percentage)
with_feature(feature) do |f|
f.percentage = percentage