Extract method to get the stats key in stats
This way we remove a bit of duplication and it'll be easier to change the `stats_cache` method.
This commit is contained in:
@@ -224,4 +224,8 @@ module Statisticable
|
||||
I18n.t("stats.age_range", start: start, finish: finish)
|
||||
end
|
||||
end
|
||||
|
||||
def stats_cache(key, &)
|
||||
Rails.cache.fetch(full_cache_key_for(key), &)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user