Created
July 23, 2013 14:47
-
-
Save aaronjensen/6062912 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
module AllCacheKey | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def cache_key | |
pluck("COUNT(*)", "MAX(updated_at)").flatten.map(&:to_i).join("-") | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For Rails 3 you need a little bit more code: