Skip to content

Commit deaef74

Browse files
zmillmanJon Yurek
authored and
Jon Yurek
committed
Remove unnecessary memoization from content type detector
1 parent 2fe6687 commit deaef74

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/paperclip/content_type_detector.rb

+4-5
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,19 @@ def empty?
5757
end
5858

5959
def possible_types
60-
@possible_types ||= MIME::Types.type_for(@filename).collect(&:content_type)
60+
MIME::Types.type_for(@filename).collect(&:content_type)
6161
end
6262

6363
def official_types
64-
@offical_types ||= possible_types.reject{|content_type| content_type.match(/\/x-/) }
64+
possible_types.reject{|content_type| content_type.match(/\/x-/) }
6565
end
6666

6767
def types_matching_file
68-
@types_matching_file ||= possible_types.select{|content_type| content_type == type_from_file_command}
68+
possible_types.select{|content_type| content_type == type_from_file_command}
6969
end
7070

7171
def type_from_file_command
72-
@type_from_file_command ||= FileCommandContentTypeDetector.new(@filename).detect
72+
FileCommandContentTypeDetector.new(@filename).detect
7373
end
74-
7574
end
7675
end

0 commit comments

Comments
 (0)