DEV: Add support for Rails 6

Minor fixes to add Rails 6 support to Discourse, we now will boot
with RAILS_MASTER=1, all specs pass

Only one tiny deprecation left

Largest change was the way ActiveModel:Errors changed interface a
bit but there is a simple backwards compat way of working it
This commit is contained in:
Sam Saffron
2019-04-30 16:58:18 +10:00
parent cf235fbd48
commit 1be01f8dd4
31 changed files with 83 additions and 54 deletions

View File

@@ -152,7 +152,7 @@ class UploadsController < ApplicationController
upload.update_columns(retain_hours: retain_hours) if retain_hours > 0
end
upload.errors.empty? ? upload : { errors: upload.errors.values.flatten }
upload.errors.empty? ? upload : { errors: upload.errors.to_hash.values.flatten }
ensure
tempfile&.close!
end