Created
November 29, 2012 23:36
-
-
Save ericfode/4172669 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sentinel::Command.new(/incidents/, "Lists all of the incidents that Sentinel knows about") do |matches, message| | |
opts = { | |
service_id: Sentinel::DB[:room_services] | |
.join(:rooms, :id => :room_id) | |
.where(rooms__room_id: message.room_id) | |
.select(:service_id) | |
} | |
records = Sentinel::DB[:incidents].where(opts).order(created_at) | |
loop records do |record| | |
message.say Yajil::Encoder.encode(record) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment