The query is being executed each time we try and generate the link path for a stylesheet within the duration of a reqeust. Categories are not updated that often so repeating this query multiple times a request is wasteful.
At the time of this commit, there is a
ActiveRecord callback on the
Category model which clears the cache of
Stylesheet::Manager each time a category is saved.