-
-
Save mrrooijen/1462541 to your computer and use it in GitHub Desktop.
Precompile assets on Heroku with Mongoid
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
# 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