From ec3157f4db4e945911196978aee56227d865d8a6 Mon Sep 17 00:00:00 2001 From: Matt Wildig Date: Fri, 5 Oct 2012 21:24:28 +0100 Subject: [PATCH] Use type instead of mime_type in plugin.rb Template#mime_type method is deprecated in Rails 4. Use Template#type in template/plugin.rb if it's available. --- lib/haml/template/plugin.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/haml/template/plugin.rb b/lib/haml/template/plugin.rb index df17cef1..7601da01 100644 --- a/lib/haml/template/plugin.rb +++ b/lib/haml/template/plugin.rb @@ -16,7 +16,11 @@ module Haml def compile(template) options = Haml::Template.options.dup - options[:mime_type] = template.mime_type if template.respond_to? :mime_type + if template.respond_to? :type + options[:mime_type] = template.type + elsif template.respond_to? :mime_type + options[:mime_type] = template.mime_type + end options[:filename] = template.identifier Haml::Engine.new(template.source, options).compiler.precompiled_with_ambles([]) end