Class: Dashboard::LabelsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/dashboard/labels_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



7
8
9
10
11
# File 'app/controllers/dashboard/labels_controller.rb', line 7

def index
  respond_to do |format|
    format.json { render json: LabelSerializer.new.represent_appearance(labels) }
  end
end

#labelsObject



13
14
15
16
17
18
# File 'app/controllers/dashboard/labels_controller.rb', line 13

def labels
  finder_params = { project_ids: projects.select(:id) }

  LabelsFinder.new(current_user, finder_params).execute
    .select('DISTINCT ON (labels.title) labels.*')
end