Commit 5b698082 authored by Sean McGivern's avatar Sean McGivern Committed by Rémy Coutable

Rename user cohorts -> cohorts

parent 0d7645e1
......@@ -366,7 +366,7 @@ const ShortcutsBlob = require('./shortcuts_blob');
new Admin();
switch (path[1]) {
case 'application_settings':
case 'user_cohorts':
case 'cohorts':
new gl.ApplicationSettings();
break;
case 'groups':
......
class Admin::UserCohortsController < Admin::ApplicationController
class Admin::CohortsController < Admin::ApplicationController
def index
if ApplicationSetting.current.usage_ping_enabled
@cohorts = Rails.cache.fetch('user_cohorts', expires_in: 1.day) do
UserCohortsService.new.execute
@cohorts = Rails.cache.fetch('cohorts', expires_in: 1.day) do
CohortsService.new.execute
end
end
end
......
class UserCohortsService
class CohortsService
MONTHS_INCLUDED = 12
# Get a hash that looks like:
......
......@@ -27,7 +27,7 @@
= link_to admin_runners_path, title: 'Runners' do
%span
Runners
= nav_link path: 'user_cohorts#index' do
= link_to admin_user_cohorts_path, title: 'User cohorts' do
= nav_link path: 'cohorts#index' do
= link_to admin_cohorts_path, title: 'Cohorts' do
%span
User cohorts
Cohorts
......@@ -106,7 +106,7 @@ namespace :admin do
end
end
resources :user_cohorts, only: :index
resources :cohorts, only: :index
resources :builds, only: :index do
collection do
......
require 'spec_helper'
describe UserCohortsService do
describe CohortsService do
describe '#execute' do
def month_start(months_ago)
months_ago.months.ago.beginning_of_month.to_date
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment