Skip to content

Commit

Permalink
Replace update_attributes by update in data migrations
Browse files Browse the repository at this point in the history
Method update_attributes is deprecated and will be removed from Rails
6.1
  • Loading branch information
saraycp committed May 6, 2020
1 parent ce69984 commit 811ed29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def self.up
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
Expand Down
4 changes: 2 additions & 2 deletions src/api/db/data/20180214132015_project_log_entry_user_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def up
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
Expand All @@ -14,7 +14,7 @@ def down
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
Expand Down

0 comments on commit 811ed29

Please sign in to comment.