From 52695209247995ac93102016f369080998ebee47 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Tue, 17 Mar 2015 10:36:41 -0500 Subject: [PATCH] * fix bug in earliest cohort code --- admin/Gemfile | 2 +- admin/app/models/cohort.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/admin/Gemfile b/admin/Gemfile index e71c00a03..2e1799c5d 100644 --- a/admin/Gemfile +++ b/admin/Gemfile @@ -41,7 +41,7 @@ gem 'uuidtools', '2.1.2' gem 'jquery-rails' # , '2.3.0' # pinned because jquery-ui-rails was split from jquery-rails, but activeadmin doesn't support this gem yet gem 'jquery-ui-rails', '4.2.1' gem 'rails3-jquery-autocomplete' -gem 'activeadmin', github: 'activeadmin', branch: '0-6-stable' +gem 'activeadmin' #, github: 'activeadmin', branch: '0-6-stable' gem 'mime-types', '1.25' gem 'meta_search' gem 'fog', "~> 1.18.0" diff --git a/admin/app/models/cohort.rb b/admin/app/models/cohort.rb index 62b565f68..9cdef5e7a 100644 --- a/admin/app/models/cohort.rb +++ b/admin/app/models/cohort.rb @@ -56,7 +56,8 @@ class Cohort < ActiveRecord::Base def self.earliest_cohort starting = User.where(admin: false).order(:created_at).first.created_at - starting = EARLIEST_DATE if starting < EARLIEST_DATE + starting = EARLIEST_DATE if starting.nil? || starting < EARLIEST_DATE + starting # this is necessary to always return not null end def self.cohort_group_ranges(starting=nil, ending=nil)