Class: Dashboard::LabelsController

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

Instance Method Summary collapse

Instance Method Details

#indexObject


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

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

#labelsObject


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

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

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