class TasksController < ApplicationController
  before_action :set_project

  include ProjectLayout

  def index
    @tasks = task_requests.completed.order_by_recent.paginate(page: params[:page])
  end

  private
  
  def set_project
    @project = policy_scope(Project).find(params[:project_id])
  end

  def task_requests
    authorize policy_scope(@project.task_requests)
  end
end
