lib/ahub/question.rb in ahub-0.11.1 vs lib/ahub/question.rb in ahub-0.11.2

- old
+ new

@@ -16,10 +16,10 @@ def self.is_question(query:) get_resource(url: "#{base_url}/isQuestion.json?q=#{URI.encode(query)}", headers: admin_headers)[:result] end def self.find_all_by_text(query:) - get_resources(url: "#{base_url}.json?q=#{URI.encode(query)}", headers: admin_headers, klass: Ahub::Question) + get_resources(url: "#{base_url}.json?q=#{URI.encode(query.downcase.strip)}", headers: admin_headers, klass: Ahub::Question) end def self.find_by_title(title) find_all_by_text(query: title).find{|question| question.title.strip.downcase == title.downcase.strip} end