]> source.dussan.org Git - redmine.git/commitdiff
Upgrade to Rails 5.2.0 (#23630).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 23 Jun 2018 05:13:29 +0000 (05:13 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 23 Jun 2018 05:13:29 +0000 (05:13 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@17410 e93f8b46-1217-0410-a6f0-8f06a7374b81

Gemfile
app/models/issue.rb
config.ru
test/unit/issue_test.rb
test/unit/user_test.rb

diff --git a/Gemfile b/Gemfile
index 64598a571df2981a46225b4b933efa71932cb036..98f27f626ba1291b914edf2ffd926b8c911b84c4 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -4,7 +4,7 @@ if Gem::Version.new(Bundler::VERSION) < Gem::Version.new('1.5.0')
   abort "Redmine requires Bundler 1.5.0 or higher (you're using #{Bundler::VERSION}).\nPlease update with 'gem update bundler'."
 end
 
-gem "rails", "5.1.6"
+gem "rails", "5.2.0"
 gem "coderay", "~> 1.1.1"
 gem "request_store", "1.0.5"
 gem "mime-types", "~> 3.0"
index 91f53c19ed1d4f53896eb7900c5f3b9f4319ba74..114d962081d520c8bb82d7a440eb61f2f0e708b6 100644 (file)
@@ -1016,8 +1016,7 @@ class Issue < ActiveRecord::Base
   # Returns the previous assignee whenever we're before the save
   # or in after_* callbacks
   def previous_assignee
-    # This is how ActiveRecord::AttributeMethods::Dirty checks if we're in a after_* callback
-    if previous_assigned_to_id = mutation_tracker.equal?(mutations_from_database) ? assigned_to_id_in_database : assigned_to_id_before_last_save
+    if previous_assigned_to_id = assigned_to_id_change_to_be_saved.nil? ? assigned_to_id_before_last_save : assigned_to_id_in_database
       Principal.find_by_id(previous_assigned_to_id)
     end
   end
index 2a89752d74b0786d0cf1910e6caad1f8f4a7c2db..5bc2a619e83ea182b17e2507c5e0f2f07f7cf18c 100644 (file)
--- a/config.ru
+++ b/config.ru
@@ -1,4 +1,4 @@
 # This file is used by Rack-based servers to start the application.
 
 require ::File.expand_path('../config/environment',  __FILE__)
-run RedmineApp::Application
+run Rails.application
index 375a1f8c21d89a644a966163c156c77d559c6cb9..40be6b66a7bddaf98540abbe476daf372466d4a7 100644 (file)
@@ -1953,11 +1953,15 @@ class IssueTest < ActiveSupport::TestCase
     user = User.find(3)
     user.members.update_all ["mail_notification = ?", false]
     user.update! :mail_notification => 'only_assigned'
-
     issue = Issue.find(2)
+
     issue.assigned_to = nil
     assert_include user.mail, issue.recipients
     issue.save!
+    assert_include user.mail, issue.recipients
+
+    issue.assigned_to = User.find(2)
+    issue.save!
     assert !issue.recipients.include?(user.mail)
   end
 
index f9678c7493fbabdd86659daad2f7e04630196a8f..95198c14858a3ed532b55541b8a3dd1d3ddf7bad 100644 (file)
@@ -1197,6 +1197,10 @@ class UserTest < ActiveSupport::TestCase
     assert assignee.notify_about?(issue)
     assert new_assignee.notify_about?(issue)
 
+    issue.save!
+    assert assignee.notify_about?(issue)
+    assert new_assignee.notify_about?(issue)
+
     issue.save!
     assert !assignee.notify_about?(issue)
     assert new_assignee.notify_about?(issue)