Created
June 7, 2012 06:05
-
-
Save trcarden/2886824 to your computer and use it in GitHub Desktop.
Engine asset compilation on heroku
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Pandemic | |
class Engine < ::Rails::Engine | |
isolate_namespace Pandemic | |
initializer "pandemic.asset_addition", :group => :all do |app| | |
initializer_path = "#{Rails.root}/config/initializers/pandemic.rb" | |
# Forces rails to pull in the initializer even if initialize_on_precompile | |
# is false | |
require initializer_path if File.exist? initializer_path | |
# Enabling assets precompiling under rails 3.1 | |
if Rails.version >= '3.1' | |
if Pandemic.is_server | |
Rails.application.config.assets.precompile += %w( pandemic/**.js pandemic/**.css ) | |
elsif Pandemic.is_client | |
Rails.application.config.assets.precompile += %w( pandemic/tracking/pandemic.js ) | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment