Skip to content

Commit

Permalink
Don't configure assets in rails API mode
Browse files Browse the repository at this point in the history
This prevents a method_missing error. See #1886
  • Loading branch information
jcoyne authored and cbeer committed Dec 15, 2018
1 parent 058b4f5 commit 6dfe4b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/blacklight/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class Engine < Rails::Engine
end

initializer "blacklight.assets.precompile" do |app|
app.config.assets.precompile += %w(favicon.ico)
# When Rails has been generated in API mode, it does not have sprockets available
app.config.assets.precompile += %w(favicon.ico) if defined? Sprockets
end

Blacklight::Engine.config.sms_mappings = {
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/blacklight/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Install < Rails::Generators::Base
class_option :devise , type: :boolean, default: false, aliases: "-d", desc: "Use Devise as authentication logic."
class_option :jettywrapper, type: :boolean, default: false, desc: "Use jettywrapper to download and control Jetty"
class_option :marc , type: :boolean, default: false, aliases: "-m", desc: "Generate MARC-based demo ."
class_option :'skip-assets', type: :boolean, default: false, desc: "Skip generating javascript and css assets into the application"
class_option :'skip-assets', type: :boolean, default: !defined?(Sprockets), desc: "Skip generating javascript and css assets into the application"
class_option :'skip-solr', type: :boolean, default: false, desc: "Skip generating solr configurations."

desc <<-EOS
Expand Down

0 comments on commit 6dfe4b4

Please sign in to comment.