Skip to content
Snippets Groups Projects
Commit 5b698082 authored by Sean McGivern's avatar Sean McGivern Committed by Rémy Coutable
Browse files

Rename user cohorts -> cohorts

parent 0d7645e1
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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':
Loading
Loading
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
Loading
Loading
class UserCohortsService
class CohortsService
MONTHS_INCLUDED = 12
 
# Get a hash that looks like:
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment