Commit 549c08ff authored by jplang's avatar jplang

No validation errors when entering an invalid "Estimate hours" value (#27881).

Patch by Go MAEDA.

git-svn-id: e93f8b46-1217-0410-a6f0-8f06a7374b81
parent a0f67979
......@@ -440,7 +440,7 @@ class Issue < ActiveRecord::Base
def estimated_hours=(h)
write_attribute :estimated_hours, (h.is_a?(String) ? h.to_hours : h)
write_attribute :estimated_hours, (h.is_a?(String) ? (h.to_hours || h) : h)
safe_attributes 'project_id',
......@@ -128,7 +128,7 @@ class IssueTest < ActiveSupport::TestCase
def test_estimated_hours_should_be_validated
set_language_if_valid 'en'
['-2'].each do |invalid|
['-2', '123abc'].each do |invalid|
issue = => invalid)
assert !issue.valid?
assert_include 'Estimated time is invalid', issue.errors.full_messages
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment