samvincent / rqrcode-rails3

Render QR codes with Rails 3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PNG Mime type already registered with Rails 3.2

peternash opened this issue · comments

In Rails 3.2 the PNG Mime Type is already registered so you see this error each time Rails starts:

/actionpack-3.2.1/lib/action_dispatch/http/mime_type.rb:101: warning: already initialized constant PNG

Changing line 8 of rqrcode-rails3.rb as follows prevents the error:

Mime::Type.register "image/png", :png unless Mime::Type.lookup_by_extension(:png)

That sounds right. In fact, that's better for previous versions of rails as well as there are other commonly used gems that define that mime type as well. Feel free to make a pull request, otherwise I'll add this when I get the chance.

I just merged and release 0.1.4 with your commit. Thank you very much, Peter.