method
content_type=
v7.0.0 -
Show latest stable
- Class:
ActiveStorage::Blob
content_type=(value)public
No documentation available.
# File activestorage/app/models/active_storage/blob.rb, line 343
def content_type=(value)
unless ActiveStorage.silence_invalid_content_types_warning
if INVALID_VARIABLE_CONTENT_TYPES_DEPRECATED_IN_RAILS_7.include?(value)
ActiveSupport::Deprecation.warn( #{value} is not a valid content type, it should not be used when creating a blob, and support for it will be removed in Rails 7.1. If you want to keep supporting this content type past Rails 7.1, add it to `config.active_storage.variable_content_types`. Dismiss this warning by setting `config.active_storage.silence_invalid_content_types_warning = true`..squish)
end
if INVALID_VARIABLE_CONTENT_TYPES_TO_SERVE_AS_BINARY_DEPRECATED_IN_RAILS_7.include?(value)
ActiveSupport::Deprecation.warn( #{value} is not a valid content type, it should not be used when creating a blob, and support for it will be removed in Rails 7.1. If you want to keep supporting this content type past Rails 7.1, add it to `config.active_storage.content_types_to_serve_as_binary`. Dismiss this warning by setting `config.active_storage.silence_invalid_content_types_warning = true`..squish)
end
end
super
end