Created
September 25, 2012 17:38
-
-
Save remi/3783343 to your computer and use it in GitHub Desktop.
Clear Rails cache store and do it fast (without loading the whole Rails environment)
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
# bundle exec rake cache:clear | |
namespace :cache do | |
desc "Clear Rails.cache" | |
task :clear do | |
Object.const_set "RAILS_CACHE", ActiveSupport::Cache.lookup_store(Rails.configuration.cache_store) | |
Rails.cache.clear | |
puts "Successfully cleared Rails.cache!" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment