Skip to content

Commit

Permalink
Added check for assets config [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Oct 9, 2024
1 parent 0f32158 commit 7dc6650
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/chartkick/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Engine < ::Rails::Engine

# for importmap
initializer "chartkick.importmap" do |app|
if defined?(Importmap) && defined?(Sprockets)
if app.config.respond_to?(:assets) && defined?(Importmap) && defined?(Sprockets)
app.config.assets.precompile << "chartkick.js"
app.config.assets.precompile << "Chart.bundle.js"
end
Expand Down

0 comments on commit 7dc6650

Please sign in to comment.