add FeatureFlagger to HomeController instead of making calls to Role directly
This commit is contained in:
parent
0ed7fd53cf
commit
ab99154a1a
2 changed files with 7 additions and 1 deletions
|
|
@ -5,7 +5,9 @@
|
||||||
class HomeController < ApplicationController
|
class HomeController < ApplicationController
|
||||||
def show
|
def show
|
||||||
if current_user
|
if current_user
|
||||||
if(Role.is_beta?(current_user.person) || Role.is_admin?(current_user.person)) && current_user.contacts.receiving.count == 0
|
flag = FeatureFlagger.new(current_user, current_user.person)
|
||||||
|
|
||||||
|
if flag.new_profile? && flag.following_enabled?
|
||||||
redirect_to person_path(current_user.person.guid)
|
redirect_to person_path(current_user.person.guid)
|
||||||
else
|
else
|
||||||
redirect_to stream_path
|
redirect_to stream_path
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,10 @@ class FeatureFlagger
|
||||||
ENV["NEW_HOTNESS"]
|
ENV["NEW_HOTNESS"]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def following_enabled?
|
||||||
|
person_is_beta? && @current_user.contacts.receiving.count == 0
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def developer?
|
def developer?
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue