ryanb / letter_opener

Preview mail in the browser instead of sending.
MIT License
3.73k stars 237 forks source link

Fix non-Rails with actionmailer 4.2.3 #109

Closed fw42 closed 9 years ago

fw42 commented 9 years ago

The latest version of letter_opener doesn't work with the latest version of actionmailer when being used standalone (without Rails). I believe the reason is that the "Rails" constant is being defined by actionmailer (or rather by rails-html-sanitizer).

This PR fixes that by also checking for "Rails::Railtie". Not a nice fix, but works.

@ryanb @davidcornu please take a quick look

davidcornu commented 9 years ago

@fw42 minor comment, otherwise :+1:

nashby commented 9 years ago

@fw42 @davidcornu thank you guys! I just pushed a fix with checking for Rails::Railtie.