lib/birdwatcher/commands/status.rb in birdwatcher-0.1.0 vs lib/birdwatcher/commands/status.rb in birdwatcher-0.3.1
- old
+ new
@@ -64,16 +64,16 @@
end
end
end
def search_statuses
- search_term = arguments[1..-1].join(" ")
+ search_term = arguments[1..-1].join(" ").downcase
if search_term.empty?
error("You must provide a search term")
return false
end
statuses = current_workspace.statuses_dataset
- .where("text LIKE ?", "%#{search_term}%")
+ .where("lower(text) LIKE ?", "%#{search_term}%")
.order(Sequel.desc(:posted_at))
.eager(:user)
.limit(1000)
texts = statuses.map { |s| make_status_summary_output(s) }.join("\n#{Birdwatcher::Console::LINE_SEPARATOR}\n\n")
page_text(texts)