added a nil check, for pre-mongo days
This commit is contained in:
parent
c98f2d1664
commit
386697f711
1 changed files with 6 additions and 4 deletions
|
|
@ -23,6 +23,7 @@ class AdminsController < ApplicationController
|
||||||
@created_users_by_day = User.where("username IS NOT NULL").count(:group => "date(created_at)")
|
@created_users_by_day = User.where("username IS NOT NULL").count(:group => "date(created_at)")
|
||||||
@created_users_by_week = {}
|
@created_users_by_week = {}
|
||||||
@created_users_by_day.keys.each do |k|
|
@created_users_by_day.keys.each do |k|
|
||||||
|
unless k.nil?
|
||||||
if @created_users_by_week[k.beginning_of_week].blank?
|
if @created_users_by_week[k.beginning_of_week].blank?
|
||||||
@created_users_by_week[k.beginning_of_week] = @created_users_by_day[k]
|
@created_users_by_week[k.beginning_of_week] = @created_users_by_day[k]
|
||||||
else
|
else
|
||||||
|
|
@ -30,6 +31,7 @@ class AdminsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def stats
|
def stats
|
||||||
@popular_tags = ActsAsTaggableOn::Tagging.joins(:tag).limit(15).count(:group => :tag, :order => 'count(taggings.id) DESC')
|
@popular_tags = ActsAsTaggableOn::Tagging.joins(:tag).limit(15).count(:group => :tag, :order => 'count(taggings.id) DESC')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue