diff options
author | ThibG <thib@sitedethib.com> | 2020-05-28 14:53:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-28 14:53:36 +0200 |
commit | 39aa6301eb874963f214215d27f9ef5874c4d236 (patch) | |
tree | c3687b1e83926abf052d58333a0047585f2df2cf /config/initializers | |
parent | ead09f5ddc73034fcd573b459868dd1ca13b647a (diff) | |
parent | 0b01492276f47bc8df8c1679b705ce33b3639fcf (diff) |
Merge pull request #1337 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/chewy.rb | 19 | ||||
-rw-r--r-- | config/initializers/paperclip.rb | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/config/initializers/chewy.rb b/config/initializers/chewy.rb index 18d2f18c1..8f54abf77 100644 --- a/config/initializers/chewy.rb +++ b/config/initializers/chewy.rb @@ -29,3 +29,22 @@ end # Mastodon is run with hidden services enabled, because # ElasticSearch is *not* supposed to be accessed through a proxy Faraday.ignore_env_proxy = true + +# Elasticsearch 7.x workaround +Elasticsearch::Transport::Client.prepend Module.new { + def search(arguments = {}) + arguments[:rest_total_hits_as_int] = true + super arguments + end +} +Elasticsearch::API::Indices::IndicesClient.prepend Module.new { + def create(arguments = {}) + arguments[:include_type_name] = true + super arguments + end + + def put_mapping(arguments = {}) + arguments[:include_type_name] = true + super arguments + end +} diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb index 0dd7f8cf8..ebb009065 100644 --- a/config/initializers/paperclip.rb +++ b/config/initializers/paperclip.rb @@ -111,3 +111,5 @@ else url: ENV.fetch('PAPERCLIP_ROOT_URL', '/system') + '/:prefix_url:class/:attachment/:id_partition/:style/:filename', ) end + +Paperclip.options[:content_type_mappings] = { csv: Import::FILE_TYPES } |