Skip to content

Instantly share code, notes, and snippets.

@joshed-io
Forked from mulder/assets.rake
Created March 24, 2012 00:21
Show Gist options
  • Save joshed-io/2176663 to your computer and use it in GitHub Desktop.
Save joshed-io/2176663 to your computer and use it in GitHub Desktop.
Monkey Patch for assets:precomple for deploying on Heroku with Mongoid
# This version worked for me.
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