##// END OF EJS Templates
Force TimeEntry#hours default to nil (#3075, #4449)....
Jean-Philippe Lang -
r3118:d63784569f49
parent child
Show More
@@ -44,6 +44,7 class TimeEntry < ActiveRecord::Base
44 if default_activity = TimeEntryActivity.default
44 if default_activity = TimeEntryActivity.default
45 self.activity_id = default_activity.id
45 self.activity_id = default_activity.id
46 end
46 end
47 self.hours = nil if hours == 0
47 end
48 end
48 end
49 end
49
50
@@ -44,4 +44,8 class TimeEntryTest < ActiveSupport::TestCase
44 assert_equal v, t.hours, "Converting #{k} failed:"
44 assert_equal v, t.hours, "Converting #{k} failed:"
45 end
45 end
46 end
46 end
47
48 def test_hours_should_default_to_nil
49 assert_nil TimeEntry.new.hours
50 end
47 end
51 end
General Comments 0
You need to be logged in to leave comments. Login now