Загрузка файла ActiveStorage S3 неопределенное ключевое слово content_type - PullRequest
0 голосов
/ 30 ноября 2018

Я сталкиваюсь с проблемой ActiveStorage при загрузке файла в S3.

Я получаю ArgumentError (неизвестное ключевое слово: content_type) в active_storage / service / s3_service.rb и не могу найти источникпроблема.

Stacktrace:

ArgumentError: unknown keyword: content_type
  from active_storage/service/s3_service.rb:19:in `upload'
  from active_storage/blob.rb:155:in `upload'
  from active_storage/blob.rb:53:in `block in build_after_upload'
  from active_storage/blob.rb:48:in `tap'
  from active_storage/blob.rb:48:in `build_after_upload'
  from active_storage/blob.rb:61:in `create_after_upload!'
  from active_storage/attached.rb:23:in `create_blob_from'
  from active_storage/attached/one.rb:24:in `attach'
  from app/controllers/admin/venues_controller.rb:48:in `update'
  from action_controller/metal/basic_implicit_render.rb:6:in `send_action'
  from abstract_controller/base.rb:194:in `process_action'
  from action_controller/metal/rendering.rb:30:in `process_action'
  from abstract_controller/callbacks.rb:42:in `block in process_action'
  from active_support/callbacks.rb:109:in `block in run_callbacks'
  from raven/integrations/rails/controller_transaction.rb:7:in `block in included'
  from active_support/callbacks.rb:118:in `instance_exec'
  from active_support/callbacks.rb:118:in `block in run_callbacks'
  from active_support/callbacks.rb:136:in `run_callbacks'
  from abstract_controller/callbacks.rb:41:in `process_action'
  from action_controller/metal/rescue.rb:22:in `process_action'
  from action_controller/metal/instrumentation.rb:34:in `block in process_action'
  from active_support/notifications.rb:168:in `block in instrument'
  from active_support/notifications/instrumenter.rb:23:in `instrument'
  from active_support/notifications.rb:168:in `instrument'
  from action_controller/metal/instrumentation.rb:32:in `process_action'
  from action_controller/metal/params_wrapper.rb:256:in `process_action'
  from active_record/railties/controller_runtime.rb:24:in `process_action'
  from abstract_controller/base.rb:134:in `process'
  from action_view/rendering.rb:32:in `process'
  from action_controller/metal.rb:191:in `dispatch'
  from action_controller/metal.rb:252:in `dispatch'
  from action_dispatch/routing/route_set.rb:52:in `dispatch'
  from action_dispatch/routing/route_set.rb:34:in `serve'
  from action_dispatch/journey/router.rb:52:in `block in serve'
  from action_dispatch/journey/router.rb:35:in `each'
  from action_dispatch/journey/router.rb:35:in `serve'
  from action_dispatch/routing/route_set.rb:840:in `call'
  from skylight/core/probes/action_dispatch/routing/route_set.rb:14:in `block in call'
  from skylight/core/fanout.rb:25:in `instrument'
  from skylight/core/probes/action_dispatch/routing/route_set.rb:13:in `call'
  from warden/jwt_auth/middleware/token_dispatcher.rb:20:in `call'
  from warden/jwt_auth/middleware/revocation_manager.rb:21:in `call'
  from rack/builder.rb:153:in `call'
  from warden/jwt_auth/middleware.rb:23:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from i18n/js/middleware.rb:14:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from warden/manager.rb:36:in `block in call'
  from warden/manager.rb:34:in `catch'
  from warden/manager.rb:34:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from rack/tempfile_reaper.rb:15:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from rack/etag.rb:25:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from rack/conditional_get.rb:38:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from rack/head.rb:12:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from action_dispatch/http/content_security_policy.rb:18:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from rack/session/abstract/id.rb:232:in `context'
  from rack/session/abstract/id.rb:226:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from action_dispatch/middleware/cookies.rb:670:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from action_dispatch/middleware/callbacks.rb:28:in `block in call'
  from active_support/callbacks.rb:98:in `run_callbacks'
  from action_dispatch/middleware/callbacks.rb:26:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from action_dispatch/middleware/debug_exceptions.rb:61:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from action_dispatch/middleware/show_exceptions.rb:33:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from rails/rack/logger.rb:38:in `call_app'
  from rails/rack/logger.rb:26:in `block in call'
  from active_support/tagged_logging.rb:71:in `block in tagged'
  from active_support/tagged_logging.rb:28:in `tagged'
  from active_support/tagged_logging.rb:71:in `tagged'
  from rails/rack/logger.rb:26:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from action_dispatch/middleware/remote_ip.rb:81:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from request_store/middleware.rb:19:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from action_dispatch/middleware/request_id.rb:27:in `call'
  from skylight/core/probes/action_dispatch/request_id.rb:12:in `call'
  from rack/method_override.rb:22:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from rack/runtime.rb:22:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from action_dispatch/middleware/executor.rb:14:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from rack/sendfile.rb:111:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from action_dispatch/middleware/ssl.rb:74:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from raven/integrations/rack.rb:51:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from rack/cors.rb:97:in `call'
  from skylight/core/probes/middleware.rb:26:in `call'
  from rails/engine.rb:524:in `call'
  from puma/configuration.rb:225:in `call'
  from puma/server.rb:658:in `handle_request'
  from puma/server.rb:472:in `process_client'
  from puma/server.rb:332:in `block in run'
  from puma/thread_pool.rb:133:in `block in spawn_thread'

Модель имеет один прикрепленный логотип (изображение), и я пытаюсь обновить модель с изображением.

has_one_attached :logo

@venue.logo.attach(venue_params[:logo]) if venue_params[:logo].present?

Я просмотрел источник ActiveStorageна GitHub, но я не могу найти проблему с аргументом.

Заранее большое спасибо!

...