Permalink
Browse files

use unless and || since these options are boolean

  • Loading branch information...
1 parent 074c8ef commit 20d5ebfb80ab68f0b1d6e0ff25132bf97a2fc546 @tenderlove tenderlove committed May 9, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_dispatch/http/url.rb
@@ -55,7 +55,7 @@ def url_for(options = {})
private
def build_host_url(options)
- if options[:host].blank? && options[:only_path].blank?
+ unless options[:host] || options[:only_path]
raise ArgumentError, 'Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true'
end

0 comments on commit 20d5ebf

Please sign in to comment.