Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Default to Paperclip::ContentTypeDetector #2270

Merged
merged 2 commits into from
Aug 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/paperclip/io_adapters/uploaded_file_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def cache_current_values
end

def content_type_detector
self.class.content_type_detector
self.class.content_type_detector || Paperclip::ContentTypeDetector
end

def determine_content_type
Expand Down
4 changes: 2 additions & 2 deletions spec/paperclip/io_adapters/uploaded_file_adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class UploadedFile < OpenStruct; end
end

it "gets the content type" do
assert_equal "image/x-png-by-browser", @subject.content_type
assert_equal "image/png", @subject.content_type
end

it "gets the file's size" do
Expand Down Expand Up @@ -98,7 +98,7 @@ class UploadedFile < OpenStruct; end
end

it "gets the content type" do
assert_equal "image/x-png-by-browser", @subject.content_type
assert_equal "image/png", @subject.content_type
end

it "gets the file's size" do
Expand Down