Class: Dashboard::LabelsController

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

Instance Method Summary collapse

Instance Method Details

#indexObject


4
5
6
7
8
# File 'app/controllers/dashboard/labels_controller.rb', line 4

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

#labelsObject


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

def labels
  finder_params = { project_ids: projects.select(:id) }
  labels = LabelsFinder.new(current_user, finder_params).execute

  GlobalLabel.build_collection(labels)
end