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:
parent
32c7e85800
commit
ec3157f4db
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue