diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index b8a0bf7a..363489ac 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -2,7 +2,10 @@ class ProjectsController < ApplicationController before_action :set_team, only: [:index, :new, :create] def index - @projects = @team.projects.select(:id, :name, :created_at, :updated_at) + @team_projects = @team.projects.select(:id, :source, :updated_at) + .order(Arel.sql("source->>'name'")) + .pluck(:id, Arel.sql("source->>'name'"), :updated_at) + .map { |id, name, updated_at| OpenStruct.new(id: id, name: name, updated_at: updated_at) } render layout: "team" end diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index 9d7784e5..998efb9e 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -9,9 +9,9 @@