Browse files

Do not redefine the Mime::Type if it is already defined. This prevent…

…s an error since "applcation/pdf" is already defined in either ActiveSupport or Mime::Type gems.
  • Loading branch information...
1 parent b818e20 commit ba407598714b809aec22410a5fb00b2c0e6794a4 Aditya Sanghi committed Dec 26, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/prawn_rails.rb
View
2 lib/prawn_rails.rb
@@ -43,6 +43,6 @@ def self.call(template)
end
end
-Mime::Type.register_alias "application/pdf", :pdf
+Mime::Type.register_alias("application/pdf", :pdf) unless Mime::Type.lookup_by_extension(:pdf)
ActionView::Template.register_template_handler(:prawn, Prawn::Rails::TemplateHandler)
ActionView::Base.send(:include, Prawn::Rails::PrawnHelper)

0 comments on commit ba40759

Please sign in to comment.