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

Commit

Permalink
Default to Paperclip::ContentTypeDetector (#2270)
Browse files Browse the repository at this point in the history
* Add default `content_type_detector` to `UploadedFileAdapter`
  • Loading branch information
ivanoblomov authored and tute committed Aug 19, 2016
1 parent a67f296 commit 24fd060
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit 24fd060

Please sign in to comment.