From a4cdf1e44ae05c0233794fcf6949b781ca5a6076 Mon Sep 17 00:00:00 2001 From: Mikhail Nelaev Date: Mon, 3 Sep 2018 18:29:27 +0500 Subject: [PATCH] Fixes wrong city and country order in query --- lib/open_weather/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/open_weather/base.rb b/lib/open_weather/base.rb index f34cf94..b4ead9e 100644 --- a/lib/open_weather/base.rb +++ b/lib/open_weather/base.rb @@ -30,7 +30,7 @@ def extract_options!(options) options.keys.each { |k| options.delete(k) unless valid_options.include?(k) } if options[:city] || options[:country] - options[:q] = "#{options[:country]},#{options[:city]}" + options[:q] = [options[:city], options[:country]].compact.join(',') options.delete(:city) options.delete(:country) end