diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-06-17 12:00:23 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-06-17 12:54:19 -0700 |
commit | 4fad953f90f82e860a69d67745887b40d5b15475 (patch) | |
tree | f66c81f08091549160ce064dce257017f5567282 /actionpack/lib/action_dispatch | |
parent | de388ba864ab47cbb3d92b3a36af254540788ed5 (diff) | |
download | rails-4fad953f90f82e860a69d67745887b40d5b15475.tar.gz rails-4fad953f90f82e860a69d67745887b40d5b15475.tar.bz2 rails-4fad953f90f82e860a69d67745887b40d5b15475.zip |
Fixing pending tests and fixed some formats / partial rendering semantics
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/mime_type.rb | 14 | ||||
-rwxr-xr-x | actionpack/lib/action_dispatch/http/request.rb | 10 |
2 files changed, 17 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/http/mime_type.rb b/actionpack/lib/action_dispatch/http/mime_type.rb index 25156a4c75..dda6604bdd 100644 --- a/actionpack/lib/action_dispatch/http/mime_type.rb +++ b/actionpack/lib/action_dispatch/http/mime_type.rb @@ -2,7 +2,19 @@ require 'set' require 'active_support/core_ext/class/attribute_accessors' module Mime - SET = [] + class Mimes < Array + def symbols + @symbols ||= map {|m| m.to_sym } + end + + %w(<< concat shift unshift push pop []= clear compact! collect! + delete delete_at delete_if flatten! map! insert reject! reverse! + replace slice! sort! uniq!).each do |method| + define_method(method) { @symbols = nil; super } + end + end + + SET = Mimes.new EXTENSION_LOOKUP = {} LOOKUP = Hash.new { |h, k| h[k] = Type.new(k) unless k.blank? } diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index 140feb9a68..3f23a5af7a 100755 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -180,12 +180,10 @@ module ActionDispatch else accepts.dup end.tap do |ret| - if defined?(ActionController::Http) - if ret == ONLY_ALL - ret.replace Mime::SET - elsif all = ret.index(Mime::ALL) - ret.delete_at(all) && ret.insert(all, *Mime::SET) - end + if ret == ONLY_ALL + ret.replace Mime::SET + elsif all = ret.index(Mime::ALL) + ret.delete_at(all) && ret.insert(all, *Mime::SET) end end else |