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'); ...@@ -366,7 +366,7 @@ const ShortcutsBlob = require('./shortcuts_blob');
new Admin(); new Admin();
switch (path[1]) { switch (path[1]) {
case 'application_settings': case 'application_settings':
case 'user_cohorts': case 'cohorts':
new gl.ApplicationSettings(); new gl.ApplicationSettings();
break; break;
case 'groups': case 'groups':
......
class Admin::UserCohortsController < Admin::ApplicationController class Admin::CohortsController < Admin::ApplicationController
def index def index
if ApplicationSetting.current.usage_ping_enabled if ApplicationSetting.current.usage_ping_enabled
@cohorts = Rails.cache.fetch('user_cohorts', expires_in: 1.day) do @cohorts = Rails.cache.fetch('cohorts', expires_in: 1.day) do
UserCohortsService.new.execute CohortsService.new.execute
end end
end end
end end
......
class UserCohortsService class CohortsService
MONTHS_INCLUDED = 12 MONTHS_INCLUDED = 12
# Get a hash that looks like: # Get a hash that looks like:
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
= link_to admin_runners_path, title: 'Runners' do = link_to admin_runners_path, title: 'Runners' do
%span %span
Runners Runners
= nav_link path: 'user_cohorts#index' do = nav_link path: 'cohorts#index' do
= link_to admin_user_cohorts_path, title: 'User cohorts' do = link_to admin_cohorts_path, title: 'Cohorts' do
%span %span
User cohorts Cohorts
...@@ -106,7 +106,7 @@ namespace :admin do ...@@ -106,7 +106,7 @@ namespace :admin do
end end
end end
resources :user_cohorts, only: :index resources :cohorts, only: :index
resources :builds, only: :index do resources :builds, only: :index do
collection do collection do
......
require 'spec_helper' require 'spec_helper'
describe UserCohortsService do describe CohortsService do
describe '#execute' do describe '#execute' do
def month_start(months_ago) def month_start(months_ago)
months_ago.months.ago.beginning_of_month.to_date 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