From 3ac630f9f3dd4bdbe0b1fe19e7c458143657ee2d Mon Sep 17 00:00:00 2001 From: Jason Denney Date: Tue, 1 Jan 2013 20:49:30 -0500 Subject: [PATCH] Round hours on stats page --- app/models/user.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index ac31107..e352105 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -35,7 +35,7 @@ class User < ActiveRecord::Base end def total_hours - ActsAsLoggable::Log.where( :loggable_type => self.class.to_s, :loggable_id => self.id).sum { |l| (l.end_date - l.start_date)/3600 } + ActsAsLoggable::Log.where( :loggable_type => self.class.to_s, :loggable_id => self.id).sum { |l| (l.end_date - l.start_date)/3600 }.round(2) end def current_month_hours @@ -45,5 +45,6 @@ class User < ActiveRecord::Base .where( :start_date => current_month_range) .where( :end_date => current_month_range) .sum { |l| (l.end_date - l.start_date)/3600 } + .round(2) end end