summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-03 08:10:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-03 08:10:20 +0000
commit1870a2e4fb7ba83e856ec85f62675c3c649d1e86 (patch)
tree42e57e726b891867fa22dedee8c27f44400f1d13
parent58dc4455cb4708be16eea61572b81db972d9279a (diff)
downloadredmine-1870a2e4fb7ba83e856ec85f62675c3c649d1e86.tar.gz
redmine-1870a2e4fb7ba83e856ec85f62675c3c649d1e86.zip
Make sure that the journal is not created if issue is saved.
git-svn-id: http://svn.redmine.org/redmine/trunk@16599 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/changeset.rb2
-rw-r--r--app/models/issue.rb5
2 files changed, 7 insertions, 0 deletions
diff --git a/app/models/changeset.rb b/app/models/changeset.rb
index edfe85756..0c6ef2977 100644
--- a/app/models/changeset.rb
+++ b/app/models/changeset.rb
@@ -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
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 7d411fc94..d5a43ed18 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -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)