Log In
Log In
Places
All Projects
Status Monitor
Collapse sidebar
obs:server:fedora:2.10:testing
obs-server
obs-server-2.10-0127-Replace-update_attributes-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File obs-server-2.10-0127-Replace-update_attributes-by-update-in-data-migratio.patch of Package obs-server
From 573d365e6728202338427bb82943eb171fe89393 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.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Contact
Support
@OBShq
The Open Build Service is an
openSUSE project
.
Log In
Places
Places
All Projects
Status Monitor