lib/ahub/question.rb in ahub-0.11.0 vs lib/ahub/question.rb in ahub-0.11.1
- old
+ new
@@ -20,10 +20,10 @@
def self.find_all_by_text(query:)
get_resources(url: "#{base_url}.json?q=#{URI.encode(query)}", headers: admin_headers, klass: Ahub::Question)
end
def self.find_by_title(title)
- find_all_by_text(query: title).find{|question| question.title == title}
+ find_all_by_text(query: title).find{|question| question.title.strip.downcase == title.downcase.strip}
end
attr_accessor :title, :body, :body_as_html
def initialize(attrs)