mirror of
				https://github.com/fspc/BikeShed-1.git
				synced 2025-11-03 17:15:34 -05:00 
			
		
		
		
	Round hours on stats page
This commit is contained in:
		
							parent
							
								
									665cc9f97a
								
							
						
					
					
						commit
						3ac630f9f3
					
				@ -35,7 +35,7 @@ class User < ActiveRecord::Base
 | 
				
			|||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def total_hours
 | 
					  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
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def current_month_hours
 | 
					  def current_month_hours
 | 
				
			||||||
@ -45,5 +45,6 @@ class User < ActiveRecord::Base
 | 
				
			|||||||
      .where( :start_date => current_month_range)
 | 
					      .where( :start_date => current_month_range)
 | 
				
			||||||
      .where( :end_date => current_month_range)
 | 
					      .where( :end_date => current_month_range)
 | 
				
			||||||
      .sum { |l| (l.end_date - l.start_date)/3600 }
 | 
					      .sum { |l| (l.end_date - l.start_date)/3600 }
 | 
				
			||||||
 | 
					      .round(2)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user