提交 5b698082 编写于 作者: S Sean McGivern 提交者: Rémy Coutable

Rename user cohorts -> cohorts

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册