Skip to content

Instantly share code, notes, and snippets.

@mrrooijen
Forked from rmm5t/assets.rake
Created December 11, 2011 20:22
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 mrrooijen/1462541 to your computer and use it in GitHub Desktop.
Save mrrooijen/1462541 to your computer and use it in GitHub Desktop.
Precompile assets on Heroku with Mongoid
# The premise behind this was borrowed from https://gist.github.com/1239732
namespace :assets do
# Prepend the assets:prepare task to assets:precompile through
# assets:environment
task :environment => :prepare
task :prepare do
# Flag for custom initializers to know we're precompiling assets
ENV["RAILS_ASSETS_PRECOMPILE"] = "true"
# Prevent mongoid from loading
def Mongoid.load!(*args)
true
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment