aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-08-25 01:20:51 +0200
committerPiotr Sarnacki <drogus@gmail.com>2012-08-28 11:19:36 +0200
commit582a7f459990487659886b90e54c22e055c65870 (patch)
treef878fec6bf0830709bf4a00e4de64d621d976eb2 /actionpack/lib
parent3fb10fd4790841ab82c4f0697b5527b7d6a40c6c (diff)
downloadrails-582a7f459990487659886b90e54c22e055c65870.tar.gz
rails-582a7f459990487659886b90e54c22e055c65870.tar.bz2
rails-582a7f459990487659886b90e54c22e055c65870.zip
Deprecate Template#mime_type
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/template.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index c36b06a83d..379cdc8a25 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -1,5 +1,6 @@
require 'active_support/core_ext/object/try'
require 'active_support/core_ext/kernel/singleton_class'
+require 'active_support/deprecation'
require 'thread'
module ActionView
@@ -147,6 +148,11 @@ module ActionView
handle_render_error(view, e)
end
+ def mime_type
+ ActiveSupport::Deprecation.warn 'Template#mime_type is deprecated and will be removed in Rails 4.1. Please use type method instead.'
+ @mime_type ||= Mime::Type.lookup_by_extension(@formats.first.to_s) if @formats.first
+ end
+
def type
@type ||= Types[@formats.first] if @formats.first
end