]> source.dussan.org Git - redmine.git/commitdiff
Make sure that the journal is not created if issue is saved.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 3 Jun 2017 08:10:20 +0000 (08:10 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 3 Jun 2017 08:10:20 +0000 (08:10 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@16599 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/changeset.rb
app/models/issue.rb

index edfe8575640c7c01f53c6c2b4f11290f0e730574..0c6ef2977ebe3d8bd4c5249b9855e23d31321d42 100644 (file)
@@ -247,6 +247,8 @@ class Changeset < ActiveRecord::Base
       unless issue.save
         logger.warn("Issue ##{issue.id} could not be saved by changeset #{id}: #{issue.errors.full_messages}") if logger
       end
+    else
+      issue.clear_journal
     end
     issue
   end
index 7d411fc9466d1b1c2f73fe238fb1381c34fed9eb..d5a43ed1811f57c803c07f50d387f5be68c3b68c 100644 (file)
@@ -813,6 +813,11 @@ class Issue < ActiveRecord::Base
     @current_journal
   end
 
+  # Clears the current journal
+  def clear_journal
+    @current_journal = nil
+  end
+
   # Returns the names of attributes that are journalized when updating the issue
   def journalized_attribute_names
     names = Issue.column_names - %w(id root_id lft rgt lock_version created_on updated_on closed_on)