Skip to content

Instantly share code, notes, and snippets.

@trcarden
Created June 7, 2012 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trcarden/2886824 to your computer and use it in GitHub Desktop.
Save trcarden/2886824 to your computer and use it in GitHub Desktop.
Engine asset compilation on heroku
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