Rails 5 helpers to fetch tasks with different filters
One possible improvement is using scopes:

def get_projects_owed
  current_user.projects.owed.recent_first.pluck(:name, :start_date, :end_date)
end

def get_all_projects
  current_user.projects.recent_first.pluck(:name, :start_date, :end_date)
end

def get_last_task_owed
  get_owed_tasks.last.task_end_date.strftime("%B %d, %Y")
end

def get_first_task_owed
  get_owed_tasks.first.task_end_date.strftime("%B %d, %Y")
end

def get_owed_tasks
  tasks = @project.tasks
  tasks.owed.order('task_end_date DESC')
end

helper_method :get_owed_tasks


class Project
  scope :owed, -&gt; { where('end_date &gt; ?', Date.today) }
  scope :recent_first, -&gt; { order(:start_date) }
end


class Task
  scope :owed, -&gt; { where('task_end_date &gt;= ?', Date.today) }
end