Class: Muzang::Plugins::Grep::Message
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Muzang::Plugins::Grep::Message
- Defined in:
- lib/muzang-plugins/muzang-grep.rb
Defined Under Namespace
Classes: Migration
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.like(channel, term) ⇒ Object
18 19 20 |
# File 'lib/muzang-plugins/muzang-grep.rb', line 18 def self.like(channel, term) find(:all, :conditions => ['channel LIKE ? AND content MATCH ?' , channel, term], :order => 'created_at DESC', :limit => 20) end |
Instance Method Details
#to_text ⇒ Object
22 23 24 |
# File 'lib/muzang-plugins/muzang-grep.rb', line 22 def to_text ["### #{user} @ #{created_at}:", "> #{content}", ''].join("\n") end |