mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Replace removed method #retrieve_collector_from_mimes
https://apidock.com/rails/v4.1.8/ActionController/MimeResponds/retrieve_collector_from_mimes
This commit is contained in:
@@ -30,6 +30,22 @@ module ActionController
|
||||
(options.delete(:responder) || Spree::Responder).call(self, resources, options)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def retrieve_collector_from_mimes(mimes = nil, &block)
|
||||
mimes ||= collect_mimes_from_class_level
|
||||
collector = Collector.new(mimes, request.variant)
|
||||
block.call(collector) if block_given?
|
||||
format = collector.negotiate_format(request)
|
||||
|
||||
if format
|
||||
_process_format(format)
|
||||
collector
|
||||
else
|
||||
raise ActionController::UnknownFormat
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user