1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Return nil for Mime::NullType#ref

This commit is contained in:
Andrew White 2013-04-10 08:18:06 +01:00
parent d50df2f116
commit 24b1d4fc63
2 changed files with 5 additions and 1 deletions

View file

@ -6,7 +6,7 @@ module ActionController
# Before processing, set the request formats in current controller formats.
def process_action(*) #:nodoc:
self.formats = request.formats.select { |x| !x.nil? }.map(&:ref)
self.formats = request.formats.map(&:ref).compact
super
end

View file

@ -312,6 +312,10 @@ module Mime
true
end
def ref
nil
end
def respond_to_missing?(method, include_private = false)
method.to_s.ends_with? '?'
end