diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-12-08 17:18:28 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-12-08 17:18:28 +0000 |
commit | 2462a8581de0090d609a45b0169890c052b15c3f (patch) | |
tree | 9e18a1818c9b8f3f074e20b8a50066561606fcb2 | |
parent | ee173b64b831bd297e6d4204e17d14dbe0448137 (diff) | |
download | redmine-2462a8581de0090d609a45b0169890c052b15c3f.tar.gz redmine-2462a8581de0090d609a45b0169890c052b15c3f.zip |
Don't create a journal when creating an issue.
git-svn-id: http://svn.redmine.org/redmine/trunk@13732 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/models/journal.rb | 9 | ||||
-rw-r--r-- | test/functional/issues_controller_test.rb | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/app/models/journal.rb b/app/models/journal.rb index 681bd9b94..76731986c 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -52,10 +52,13 @@ class Journal < ActiveRecord::Base def initialize(*args) super - if journalized && journalized.new_record? - self.notify = false + if journalized + if journalized.new_record? + self.notify = false + else + start + end end - start end def save(*args) diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 566cf3ec8..91a9bc6e8 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -1799,7 +1799,8 @@ class IssuesControllerTest < ActionController::TestCase def test_post_create @request.session[:user_id] = 2 assert_difference 'Issue.count' do - post :create, :project_id => 1, + assert_no_difference 'Journal.count' do + post :create, :project_id => 1, :issue => {:tracker_id => 3, :status_id => 2, :subject => 'This is the test_new issue', @@ -1808,6 +1809,7 @@ class IssuesControllerTest < ActionController::TestCase :start_date => '2010-11-07', :estimated_hours => '', :custom_field_values => {'2' => 'Value for field 2'}} + end end assert_redirected_to :controller => 'issues', :action => 'show', :id => Issue.last.id |