Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Search results in reverse chronological order.

  • Loading branch information...
commit abfc245b3f996e9d15e7ab20b4dab2c4cc2e95fb 1 parent 89d67d4
@whitequark authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/irclogger/message.rb
View
8 lib/irclogger/message.rb
@@ -3,7 +3,7 @@
class Message < Sequel::Model(:irclog)
attr_accessor :data
- NICK_PATTERN = /^([A-Za-z_0-9|.`-]+)/
+ NICK_PATTERN = /^([A-Za-z_0-9|.`-]+)/ # `
def type
if talk?
@@ -112,19 +112,19 @@ def self.search_in_channel(channel, query)
end
def self.find_by_channel_and_kickban(channel, query)
- order(:timestamp).filter(:channel => channel).
+ order(:timestamp).reverse.filter(:channel => channel).
filter('opcode = "kick" or opcode = "ban"').
filter('nick like ?', query.strip + "%")
end
def self.find_by_channel_and_fulltext(channel, query)
- order(:timestamp).filter(:channel => channel).
+ order(:timestamp).reverse.filter(:channel => channel).
filter('opcode is null').
filter('match (nick, line) against (? in boolean mode)', query)
end
def self.find_by_channel_and_nick(channel, query)
- order(:timestamp).filter(:channel => channel).
+ order(:timestamp).reverse.filter(:channel => channel).
filter('opcode is null').
filter('nick like ?', query.strip + "%")
end
Please sign in to comment.
Something went wrong with that request. Please try again.