DEV: remove update_attributes which is deprecated in Rails 6

See: https://github.com/rails/rails/pull/31998

update_attributes is a relic of the past, it should no longer be used.
This commit is contained in:
Sam Saffron
2019-04-29 17:32:25 +10:00
parent 3b95f34e7b
commit 45285f1477
49 changed files with 103 additions and 103 deletions

View File

@ -42,7 +42,7 @@ class Admin::WebHooksController < Admin::AdminController
end
def update
if @web_hook.update_attributes(web_hook_params)
if @web_hook.update(web_hook_params)
StaffActionLogger.new(current_user).log_web_hook(@web_hook, UserHistory.actions[:web_hook_update], changes: @web_hook.saved_changes)
render_serialized(@web_hook, AdminWebHookSerializer, root: 'web_hook')
else
@ -92,7 +92,7 @@ class Admin::WebHooksController < Admin::AdminController
now = Time.zone.now
response = conn.post(headers: MultiJson.load(web_hook_event.headers), body: web_hook_event.payload)
web_hook_event.update_attributes!(status: response.status,
web_hook_event.update!(status: response.status,
response_headers: MultiJson.dump(response.headers),
response_body: response.body,
duration: ((Time.zone.now - now) * 1000).to_i)