title: ActiveRecord get all + associated details
body: <p>I am trying to retrieve a list of all tasks, where each task has a developer and reviewer. I am able to retrieve the list but it contains developer_id and reviewer_id. How do I retrieve a list containing developer name and retriever name?</p>
  
  <pre><code>class Person &lt; ActiveRecord::Base
  end
  
  class Unread_Object &lt; ActiveRecord::Base
    belongs_to :person
  end
  
  class Developer &lt; Person
    has_many :tasks 
  end
  class Reviewer &lt; Person
    has_many :tasks
    has_many :unread_objects
  end
  
  class Task &lt; ActiveRecord::Base
    belongs_to :developer
    belongs_to :reviewer
    has_many :documents
    after_save :add_task_to_unread_objects
  
    protected
      def add_task_to_unread_objects
        Person.find_each do |person|
          Unread_Object.create(
                                :person_id =&gt; person.id,
                                :internal_object_id =&gt; self.internal_object_id,
                                :unread_cause =&gt; 'Create')
        end
      end
  end
  </code></pre>
  
  <p>Things I have tried.</p>
  
  <pre><code>get '/taskslist' do
    #Task.includes([:developer, :reviewer]).all.to_json
    #Task.joins(:developer,:reviewer).select("tasks.*, people.*").to_json #works somewhat but only shows one name
    #Task.includes(:reviewer.name,:developer.name).all.to_json #"undefined method `name' for :reviewer:Symbol"
    #Task.find(:all, :include =&gt; {:people =&gt; :name}).to_json #Couldn't find all Tasks with 'id': (all, {:include=&gt;{:people=&gt;:name}}) 
  end
  </code></pre>
  
  <p>I hope to get Tasks json with nested json for developer, reviewer and other objects.
  This question is follow up of <a href="https://stackoverflow.com/questions/28261253/derived-activerecord-ruby-class">this</a>.</p>