Compass/compass-rails — pull request #154 by nbudin (2014-04-02 16:31:38+00:00)
Title: Rails.application.assets.trail isn't necessarily a Hike::Index; don't break if it's a Hike::Trail

Unfortunately I'm having trouble figuring out a reproducible case for this; however, running our app's test suite on Tddium, we ran into an error during asset precompilation. Specifically, the `@entries` instance variable didn't seem to exist on `Rails.application.assets.send(:trail)`.

Digging in further, this seems to be because sometimes that method will return a Hike::Trail rather than a Hike::Index. I'm not sure what is causing this to be the case in certain circumstances but not others (I couldn't reproduce this locally, indicating that on my laptop, for some reason, it is always a Hike::Index, but on Tddium it isn't).

But, I do have evidence of this happening in the wild, so here is a simple patch to work around the issue. I don't believe the cache-busting will be necessary if it's a Hike::Trail, because those are uncached anyhow.