Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Verifying if Rails::Application::Configuration responds to assets

  • Loading branch information...
commit 8c9e2a95666f2dc806e4f062c3251035578bc846 1 parent d73aa4d
@guiocavalcanti guiocavalcanti authored fphilipe committed
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/premailer-rails3/css_helper.rb
View
7 lib/premailer-rails3/css_helper.rb
@@ -29,7 +29,7 @@ def load_css_at_path(path)
if defined? Hassle and Rails.configuration.middleware.include? Hassle
file = path == :default ? '/stylesheets/email.css' : path
File.read("#{Rails.root}/tmp/hassle#{file}")
- elsif Rails.configuration.try(:assets).try(:enabled)
+ elsif assets_enabled?
file = if path == :default
'email.css'
else
@@ -52,5 +52,10 @@ def load_css_at_path(path)
puts ex.message
@@css_cache[path] = ''
end
+
+ def assets_enabled?
+ return false unless Rails.configuration.respond_to?(:assets)
+ Rails.configuration.assets.enabled
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.