Skip to content

Commit

Permalink
Merge pull request #26883 from y-yagi/remove_assets_config_if_skip_sp…
Browse files Browse the repository at this point in the history
…rockets_is_true

remove assets config from `new_framework_defaults` if `--skip-sprockets` is true
  • Loading branch information
rafaelfranca committed Oct 25, 2016
2 parents be623bf + 5b54a90 commit aad14c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Expand Up @@ -32,7 +32,9 @@ ActiveSupport.halt_callback_chains_on_return_false = <%= options[:update] ? true
# Configure SSL options to enable HSTS with subdomains. Previous versions had false.
Rails.application.config.ssl_options = { hsts: { subdomains: true } }
<%- end -%>
<%- unless options[:skip_sprockets] -%>

# Unknown asset fallback will return the path passed in when the given
# asset is not present in the asset pipeline.
Rails.application.config.assets.unknown_asset_fallback = <%= options[:update] ? true : false %>
<%- end -%>
3 changes: 3 additions & 0 deletions railties/test/generators/app_generator_test.rb
Expand Up @@ -412,6 +412,9 @@ def test_generator_if_skip_sprockets_is_given
assert_no_match(/config\.assets\.js_compressor = :uglifier/, content)
assert_no_match(/config\.assets\.css_compressor = :sass/, content)
end
assert_file "config/initializers/new_framework_defaults.rb" do |content|
assert_no_match(/unknown_asset_fallback/, content)
end
end

def test_generator_if_skip_action_cable_is_given
Expand Down

0 comments on commit aad14c9

Please sign in to comment.