* fix bug in earliest cohort code

This commit is contained in:
Seth Call 2015-03-17 10:36:41 -05:00
parent 188274cbb5
commit 5269520924
2 changed files with 3 additions and 2 deletions

View File

@ -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"

View File

@ -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)