diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/issues_helper.rb | 1 | ||||
-rw-r--r-- | app/models/time_entry.rb | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index b9e11c9fa..b2b85ee4c 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -36,6 +36,7 @@ module IssuesHelper # Returns a string of css classes that apply to the given issue def css_issue_classes(issue) s = "issue status-#{issue.status.position} priority-#{issue.priority.position}" + s << ' closed' if issue.closed? s << ' overdue' if issue.overdue? s end diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb index 57a75604d..f10b179d1 100644 --- a/app/models/time_entry.rb +++ b/app/models/time_entry.rb @@ -32,7 +32,7 @@ class TimeEntry < ActiveRecord::Base :description => :comments validates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_on - validates_numericality_of :hours, :allow_nil => true + validates_numericality_of :hours, :allow_nil => true, :message => :activerecord_error_invalid validates_length_of :comments, :maximum => 255, :allow_nil => true def after_initialize @@ -54,7 +54,7 @@ class TimeEntry < ActiveRecord::Base end def hours=(h) - write_attribute :hours, (h.is_a?(String) ? h.to_hours : h) + write_attribute :hours, (h.is_a?(String) ? (h.to_hours || h) : h) end # tyear, tmonth, tweek assigned where setting spent_on attributes |