Skip to content

Commit a9166e4

Browse files
committed
Create index before passing reference to router
1 parent d349c0c commit a9166e4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/sprockets/railtie.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,21 +100,21 @@ def configure(&block)
100100
end
101101
end
102102

103-
if app.config.assets.compile
104-
if app.routes.respond_to?(:prepend)
105-
app.routes.prepend do
106-
mount app.assets => app.config.assets.prefix
107-
end
108-
end
109-
end
110-
111103
# No more configuration changes at this point.
112104
# With cache classes on, Sprockets won't check the FS when files
113105
# change. Preferable in production when the FS only changes on
114106
# deploys when the app restarts.
115107
if app.config.cache_classes
116108
app.assets = app.assets.index
117109
end
110+
111+
if app.config.assets.compile
112+
if app.routes.respond_to?(:prepend)
113+
app.routes.prepend do
114+
mount app.assets => app.config.assets.prefix
115+
end
116+
end
117+
end
118118
end
119119
end
120120
end

0 commit comments

Comments
 (0)