Skip to content

Commit

Permalink
Return nil for Mime::NullType#ref
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeltrix committed Apr 10, 2013
1 parent d50df2f commit 24b1d4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_controller/metal/rendering.rb
Expand Up @@ -6,7 +6,7 @@ module Rendering


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


Expand Down
4 changes: 4 additions & 0 deletions actionpack/lib/action_dispatch/http/mime_type.rb
Expand Up @@ -312,6 +312,10 @@ def nil?
true true
end end


def ref
nil
end

def respond_to_missing?(method, include_private = false) def respond_to_missing?(method, include_private = false)
method.to_s.ends_with? '?' method.to_s.ends_with? '?'
end end
Expand Down

0 comments on commit 24b1d4f

Please sign in to comment.