Sha256: db72d06ab9e91863e0960b2dd70af2c6a2c864f6185dace6d97675a3f68f2606
Contents?: true
Size: 989 Bytes
Versions: 12
Compression:
Stored size: 989 Bytes
Contents
class DashboardController < ApplicationController def show date = Date.today year = date.year week = date.cweek last_week = 1.week.ago.to_date.cweek last_year = week == 1 ? year - 1 : year month = Date.today.month last_month = month == 1 ? 12 : month - 1 last_months_year = month == 1 ? year - 1 : year @week_day = Date.today.wday @users = [] for user in current_user.work_lock_subscriptions @users<<[user, Work.work_sum_per_week(last_year, last_week, user), Work.work_sum_per_week(year, week, user), Work.work_sum_per_day(date, user), Work.work_sum_per_month(year, month, user), Work.work_sum_per_month(last_months_year, last_month, user), Work.invoice_work_sum_per_week(last_year, last_week, user), Work.invoice_work_sum_per_week(year, week, user), Work.invoice_work_sum_per_day(date, user), Work.invoice_work_sum_per_month(year, month, user), Work.invoice_work_sum_per_month(last_months_year, last_month, user)] end end end
Version data entries
12 entries across 12 versions & 1 rubygems