]> source.dussan.org Git - redmine.git/commitdiff
Merged r14241 (#19731).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 10 May 2015 07:19:50 +0000 (07:19 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 10 May 2015 07:19:50 +0000 (07:19 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.0-stable@14247 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb
test/unit/issue_test.rb

index b2be17f2abb76838eab0b4701bae713c752b47f1..a140109078ace7578fac0af436d6284e9dbf392d 100644 (file)
@@ -1590,6 +1590,7 @@ class Issue < ActiveRecord::Base
       tracker.disabled_core_fields.each do |attribute|
         send "#{attribute}=", nil
       end
+      self.done_ratio ||= 0
     end
   end
 end
index 5e93769b8730caab523a8300aef8988ddc33d1a4..1e9d8a88815e6f1df6c5be9d46013f33a8b7cb32 100644 (file)
@@ -70,6 +70,15 @@ class IssueTest < ActiveSupport::TestCase
     assert_nil issue.estimated_hours
   end
 
+  def test_create_with_all_fields_disabled
+    tracker = Tracker.find(1)
+    tracker.core_fields = []
+    tracker.save!
+
+    issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 3, :subject => 'test_create_with_all_fields_disabled')
+    assert_save issue
+  end
+
   def test_start_date_format_should_be_validated
     set_language_if_valid 'en'
     ['2012', 'ABC', '2012-15-20'].each do |invalid_date|