diff --git a/.powenv b/.powenv new file mode 100644 index 00000000000..fa534d48232 --- /dev/null +++ b/.powenv @@ -0,0 +1 @@ +export NEW_HOTNESS=yessir diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 5684cf359d4..b02365be8d9 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -81,15 +81,12 @@ def hashes_for_people(people, aspects) def show @person = Person.find_from_guid_or_username(params) + flag = FeatureFlagger.new(current_user) - if remote_profile_with_no_user_session? - raise ActiveRecord::RecordNotFound - end - - if @person.closed_account? - redirect_to :back, :notice => t("people.show.closed_account") - return - end + raise(ActiveRecord::RecordNotFound) if remote_profile_with_no_user_session? + return redirect_to :back, :notice => t("people.show.closed_account") if @person.closed_account? + return redirect_to person_path(@person) if params[:ex] && !flag.new_profile? + return redirect_to person_path(@person, :ex => true) if !params[:ex] && flag.new_profile? && flag.new_hotness? @post_type = :all @aspect = :profile diff --git a/app/models/feature_flagger.rb b/app/models/feature_flagger.rb index de93091adde..3ad5eee2cc2 100644 --- a/app/models/feature_flagger.rb +++ b/app/models/feature_flagger.rb @@ -4,6 +4,25 @@ def initialize(current_user) end def new_publisher? - @current_user.admin? || !(Rails.env.production? || Rails.env.staging?) + admin? || developer? end + + def new_profile? + admin? + end + + def new_hotness? + ENV["NEW_HOTNESS"] + end + + protected + + def developer? + !(Rails.env.production? || Rails.env.staging?) #includes test, cucumber, or developer + end + + def admin? + @current_user.try(:admin?) + end + end