Class: Api::V1::StatsController

Inherits:
ApiController
  • Object
show all
Defined in:
app/controllers/api/v1/stats_controller.rb

Instance Method Summary collapse

Instance Method Details

#activityObject

Keeping all project endpoints out of projects for now /api/v1/activity?project_token=



16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/api/v1/stats_controller.rb', line 16

def activity
  if params[:project_token]
    @project = Project.find_by_api_access_token(params[:project_token])
    if @project
      render '/projects/api/v1/activity'
    else
      render file: "#{Rails.root}/public/404.html", layout: false, status: :not_found
    end
  end
end

#indexObject



3
4
5
6
7
8
9
10
11
12
# File 'app/controllers/api/v1/stats_controller.rb', line 3

def index
  if params[:project_token]
    project = Project.find_by_api_access_token(params[:project_token])
    if project
      @project_id = project.id
    else
      render file: "#{Rails.root}/public/404.html", layout: false, status: :not_found
    end
  end
end