diff options
author | Jeremy Daer <jeremydaer@gmail.com> | 2015-10-06 11:30:02 -0700 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2015-10-06 11:30:02 -0700 |
commit | 71317e6406dba9a552760ec035b67b3c16162528 (patch) | |
tree | 78cc5fc25b114c26e14d855370e16139dbd4b679 /actionpack/lib/action_controller/metal/mime_responds.rb | |
parent | 5b69e30622de27e8010fd8cb32a97b5f0fe194e2 (diff) | |
parent | 565094a8b5cdfa158fef6ae75252fd98a4ba8fe4 (diff) | |
download | rails-71317e6406dba9a552760ec035b67b3c16162528.tar.gz rails-71317e6406dba9a552760ec035b67b3c16162528.tar.bz2 rails-71317e6406dba9a552760ec035b67b3c16162528.zip |
Merge pull request #21869 from jeremy/mime-constant-deprecation
Use `Mime[:foo]` instead of `Mime::Type[:FOO]` for back compat
Diffstat (limited to 'actionpack/lib/action_controller/metal/mime_responds.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/mime_responds.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/metal/mime_responds.rb b/actionpack/lib/action_controller/metal/mime_responds.rb index fc42fe5c07..58df5c539e 100644 --- a/actionpack/lib/action_controller/metal/mime_responds.rb +++ b/actionpack/lib/action_controller/metal/mime_responds.rb @@ -229,14 +229,14 @@ module ActionController #:nodoc: @responses = {} @variant = variant - mimes.each { |mime| @responses[Mime::Type[mime.upcase.to_sym]] = nil } + mimes.each { |mime| @responses[Mime[mime]] = nil } end def any(*args, &block) if args.any? args.each { |type| send(type, &block) } else - custom(Mime::Type[:ALL], &block) + custom(Mime::ALL, &block) end end alias :all :any @@ -251,7 +251,7 @@ module ActionController #:nodoc: end def response - response = @responses.fetch(format, @responses[Mime::Type[:ALL]]) + response = @responses.fetch(format, @responses[Mime::ALL]) if response.is_a?(VariantCollector) # `format.html.phone` - variant inline syntax response.variant elsif response.nil? || response.arity == 0 # `format.html` - just a format, call its block |