title: Two distinct types of users want to view same routes but expecting different returns
body: <p>I have two distinct types of users that want to use the same RESTful routes. I have a polymorphic association between users and profiles, and the two types of profiles are <code>PatientProfile</code> and <code>DoctorProfile</code>. What I'm trying to do is to come up with a clean way for both user types to be able to use the same controller actions. </p>
  
  <pre><code>class User
    belongs_to :profile, polymorphic: true
  
  class PatientProfile
    has_one :user, as: :profile
  
  class DoctorProfile
    has_one :user, as: :profile
  </code></pre>
  
  <p>I have a <code>Review</code> model. </p>
  
  <pre><code># reviews_controller.rb
  def index
    # for patients this would be all reviews they wrote
    # for doctors it would be all reviews about them
    current_user.reviews
  end
  </code></pre>
  
  <p>I've taken care to run everything off of the user instead of the profile because I thought it would be cleaner. However now I'm thinking the <code>current_user</code> method should really returning the profile instead of just the user. All associations should then be made in the respective profile model. </p>
  
  <p>My question: Am I thinking about this the correct way or am I missing something? I looked into <code>CanCanCan</code> and <code>Pundit</code> but both seem to be for allowing specific actions whereas I'm trying to return distinct information based on who is requesting it.  </p>