File obs-server-2.10-0127-Replace-update_attributes-by-update-in-data-migratio.patch of Package obs-server

From de7b3ec3b726e522c4c067979eb8e8a353544958 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Saray=20Cabrera=20Padr=C3=B3n?= <scabrerapadron@suse.de>
Date: Wed, 6 May 2020 18:35:25 +0200
Subject: [PATCH] Replace update_attributes by update in data migrations

Method update_attributes is deprecated and will be removed from Rails
6.1
---
 ...70831143534_convert_notifications_event_payload_to_json.rb | 2 +-
 src/api/db/data/20180214132015_project_log_entry_user_name.rb | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/api/db/data/20170831143534_convert_notifications_event_payload_to_json.rb b/src/api/db/data/20170831143534_convert_notifications_event_payload_to_json.rb
index 2c8a473f3a..41aeb56b41 100644
--- a/src/api/db/data/20170831143534_convert_notifications_event_payload_to_json.rb
+++ b/src/api/db/data/20170831143534_convert_notifications_event_payload_to_json.rb
@@ -3,7 +3,7 @@ class ConvertNotificationsEventPayloadToJson < ActiveRecord::Migration[5.1]
     Notification20170831143534.transaction do
       Notification20170831143534.all.find_each do |notification|
         json = yaml_to_json(notification.event_payload)
-        notification.update_attributes!(event_payload: json)
+        notification.update!(event_payload: json)
       end
     end
   end
diff --git a/src/api/db/data/20180214132015_project_log_entry_user_name.rb b/src/api/db/data/20180214132015_project_log_entry_user_name.rb
index 3bf65f8423..e313cf4953 100644
--- a/src/api/db/data/20180214132015_project_log_entry_user_name.rb
+++ b/src/api/db/data/20180214132015_project_log_entry_user_name.rb
@@ -4,7 +4,7 @@ class ProjectLogEntryUserName < ActiveRecord::Migration[5.1]
       batch.each do |log_entry|
         user = User.find_by(id: log_entry.user_name).try(:login)
         user ||= User::NOBODY_LOGIN
-        log_entry.update_attributes(user_name: user)
+        log_entry.update(user_name: user)
       end
     end
   end
@@ -14,7 +14,7 @@ class ProjectLogEntryUserName < ActiveRecord::Migration[5.1]
       batch.each do |log_entry|
         user = User.find_by(login: log_entry.user_name).try(:id)
         user ||= User.find_nobody!.try(:id)
-        log_entry.update_attributes(user_name: user)
+        log_entry.update(user_name: user)
       end
     end
   end
-- 
2.31.1