1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

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.
This commit is contained in:
Matt Wildig 2012-10-05 21:24:28 +01:00 committed by Norman Clarke
parent 32c7e85800
commit ec3157f4db

View file

@ -16,7 +16,11 @@ module Haml
def compile(template) def compile(template)
options = Haml::Template.options.dup 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 options[:filename] = template.identifier
Haml::Engine.new(template.source, options).compiler.precompiled_with_ambles([]) Haml::Engine.new(template.source, options).compiler.precompiled_with_ambles([])
end end