From 9794e85351243cac6d4e78adaba634b8e4ecad0a Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Tue, 20 Feb 2018 18:08:14 -0500 Subject: Hoist update for clarity --- activestorage/app/models/active_storage/identification.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'activestorage/app/models/active_storage/identification.rb') diff --git a/activestorage/app/models/active_storage/identification.rb b/activestorage/app/models/active_storage/identification.rb index 6f55418cd8..8d334ae1ea 100644 --- a/activestorage/app/models/active_storage/identification.rb +++ b/activestorage/app/models/active_storage/identification.rb @@ -9,16 +9,11 @@ class ActiveStorage::Identification #:nodoc: @blob = blob end - def apply - blob.update!(content_type: content_type, identified: true) unless blob.identified? + def content_type + Marcel::MimeType.for(identifiable_chunk, name: filename, declared_type: declared_content_type) end private - def content_type - Marcel::MimeType.for(identifiable_chunk, name: filename, declared_type: declared_content_type) - end - - def identifiable_chunk Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") do |client| client.get(uri, "Range" => "bytes=0-4095").body -- cgit v1.2.3