ソースを参照

Force TimeEntry#hours default to nil (#3075, #4449).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3232 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/0.9.0
Jean-Philippe Lang 14年前
コミット
d63784569f
2個のファイルの変更5行の追加0行の削除
  1. 1
    0
      app/models/time_entry.rb
  2. 4
    0
      test/unit/time_entry_test.rb

+ 1
- 0
app/models/time_entry.rb ファイルの表示

@@ -44,6 +44,7 @@ class TimeEntry < ActiveRecord::Base
if default_activity = TimeEntryActivity.default
self.activity_id = default_activity.id
end
self.hours = nil if hours == 0
end
end

+ 4
- 0
test/unit/time_entry_test.rb ファイルの表示

@@ -44,4 +44,8 @@ class TimeEntryTest < ActiveSupport::TestCase
assert_equal v, t.hours, "Converting #{k} failed:"
end
end
def test_hours_should_default_to_nil
assert_nil TimeEntry.new.hours
end
end

読み込み中…
キャンセル
保存