2012-04-10 14:06:46 +00:00
|
|
|
class Channel < ActiveRecord::Base
|
2012-04-13 13:51:10 +00:00
|
|
|
store :options
|
|
|
|
|
|
|
|
def self.send2
|
|
|
|
# find outbound
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2012-04-10 14:06:46 +00:00
|
|
|
def self.fetch
|
2012-04-13 13:51:10 +00:00
|
|
|
channels = Channel.where( 'active = ? AND area LIKE ?', true, '%::Inbound' )
|
|
|
|
channels.each { |channel|
|
2012-04-10 14:06:46 +00:00
|
|
|
begin
|
2012-04-13 13:51:10 +00:00
|
|
|
c = eval 'Channel::' + channel[:adapter] + '.new'
|
2012-04-10 14:06:46 +00:00
|
|
|
c.fetch(channel)
|
|
|
|
rescue Exception => e
|
2012-04-13 13:51:10 +00:00
|
|
|
puts "can't use " + 'Channel::' + channel[:adapter]
|
2012-04-10 14:06:46 +00:00
|
|
|
puts e.inspect
|
|
|
|
end
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|