lib/inline_svg/railtie.rb in inline_svg-0.5.1 vs lib/inline_svg/railtie.rb in inline_svg-0.5.2
- old
+ new
@@ -3,12 +3,17 @@
class Railtie < ::Rails::Railtie
initializer "inline_svg.action_view" do |app|
ActiveSupport.on_load :action_view do
require "inline_svg/action_view/helpers"
include InlineSvg::ActionView::Helpers
- InlineSvg.configure do |config|
- config.asset_finder = app.instance_variable_get(:@assets) # In most cases this will be the Sprockets::Environment instance of the Rails app.
- end
+ end
+ end
+
+ config.after_initialize do |app|
+ InlineSvg.configure do |config|
+ # In default Rails apps, this will be a fully operational
+ # Sprockets::Environment instance
+ config.asset_finder = app.instance_variable_get(:@assets)
end
end
end
end