Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit ba407598714b809aec22410a5fb00b2c0e6794a4 1 parent b818e20
Aditya Sanghi authored December 26, 2011

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  lib/prawn_rails.rb
2  lib/prawn_rails.rb
@@ -43,6 +43,6 @@ def self.call(template)
43 43
   end
44 44
 end
45 45
 
46  
-Mime::Type.register_alias "application/pdf", :pdf
  46
+Mime::Type.register_alias("application/pdf", :pdf) unless Mime::Type.lookup_by_extension(:pdf)
47 47
 ActionView::Template.register_template_handler(:prawn, Prawn::Rails::TemplateHandler)
48 48
 ActionView::Base.send(:include, Prawn::Rails::PrawnHelper)

0 notes on commit ba40759

Please sign in to comment.
Something went wrong with that request. Please try again.