Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MS DC; admins are now always redirected to new profile

  • Loading branch information...
commit 340411f17cdd1be5e3fd579e62e3c2c16bb2bd7c 1 parent 87fb922
Dennis Collective denniscollective authored
1  .powenv
View
@@ -0,0 +1 @@
+export NEW_HOTNESS=yessir
13 app/controllers/people_controller.rb
View
@@ -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
21 app/models/feature_flagger.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.