summaryrefslogtreecommitdiffstats
path: root/app/models/time_entry.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-02-21 11:04:50 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-02-21 11:04:50 +0000
commitfe28193e4eb9af2dc5262535a29ffde5249568fc (patch)
treebd4cf3a9fbada98e58e510ca0e25c42bf00676a7 /app/models/time_entry.rb
parent9a986ac0a51fe844eee816325e6a6d4122136d9a (diff)
downloadredmine-fe28193e4eb9af2dc5262535a29ffde5249568fc.tar.gz
redmine-fe28193e4eb9af2dc5262535a29ffde5249568fc.zip
Merged Rails 2.2 branch. Redmine now requires Rails 2.2.2.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2493 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/time_entry.rb')
-rw-r--r--app/models/time_entry.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb
index 4cb76441b..7d165492a 100644
--- a/app/models/time_entry.rb
+++ b/app/models/time_entry.rb
@@ -26,13 +26,13 @@ class TimeEntry < ActiveRecord::Base
attr_protected :project_id, :user_id, :tyear, :tmonth, :tweek
acts_as_customizable
- acts_as_event :title => Proc.new {|o| "#{o.user}: #{lwr(:label_f_hour, o.hours)} (#{(o.issue || o.project).event_title})"},
+ acts_as_event :title => Proc.new {|o| "#{o.user}: #{l_hours(o.hours)} (#{(o.issue || o.project).event_title})"},
:url => Proc.new {|o| {:controller => 'timelog', :action => 'details', :project_id => o.project}},
:author => :user,
:description => :comments
validates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_on
- validates_numericality_of :hours, :allow_nil => true, :message => :activerecord_error_invalid
+ validates_numericality_of :hours, :allow_nil => true, :message => :invalid
validates_length_of :comments, :maximum => 255, :allow_nil => true
def after_initialize
@@ -48,9 +48,9 @@ class TimeEntry < ActiveRecord::Base
end
def validate
- errors.add :hours, :activerecord_error_invalid if hours && (hours < 0 || hours >= 1000)
- errors.add :project_id, :activerecord_error_invalid if project.nil?
- errors.add :issue_id, :activerecord_error_invalid if (issue_id && !issue) || (issue && project!=issue.project)
+ errors.add :hours, :invalid if hours && (hours < 0 || hours >= 1000)
+ errors.add :project_id, :invalid if project.nil?
+ errors.add :issue_id, :invalid if (issue_id && !issue) || (issue && project!=issue.project)
end
def hours=(h)