Skip to content

Commit 3cbb388

Browse files
committed
Run configuration blocks in after initialize
1 parent a9166e4 commit 3cbb388

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/sprockets/railtie.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ def assets
3737
env.context_class.assets_prefix = config.assets.prefix
3838
env.context_class.digest_assets = config.assets.digest
3939
env.context_class.config = config.action_controller
40-
41-
config.assets._blocks.each do |block|
42-
block.call env
43-
end
4440
end
4541

4642
@assets
@@ -100,6 +96,11 @@ def configure(&block)
10096
end
10197
end
10298

99+
# Run app.assets.configure blocks
100+
app.config.assets._blocks.each do |block|
101+
block.call app.assets
102+
end
103+
103104
# No more configuration changes at this point.
104105
# With cache classes on, Sprockets won't check the FS when files
105106
# change. Preferable in production when the FS only changes on

0 commit comments

Comments
 (0)