fix rails4 regression with asset_host Proc returning nil #10636

merged 1 commit into from May 16, 2013

2 participants


In rails4, when config.asset_host is defined as a proc, returning nil from that proc no longer behaves the same as if config.asset_host were not configured, but rather treats asset_host as an empty string, which is not useful, because it gives urls like this:

  1) Failure:
AssetTagHelperTest#test_image_path_with_asset_host_proc_returning_nil [/Users/seanwalbran/projects/rails/actionpack/test/template/asset_tag_helper_test.rb:540]:
Expected: "/images/file.tiff"
  Actual: "http:///images/file.tiff"

This PR restores the previous behavior (and adds test coverage).

@rafaelfranca rafaelfranca merged commit 4eb16e7 into rails:master May 16, 2013
@pixeltrix pixeltrix referenced this pull request in jpawlyn/rails Jul 13, 2014
Jolyon Pawlyn Fix empty host for an asset url when ActionController::Base.asset_hos…
…t returns a proc that evaluates to nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment