trabajo-afectivo/app/models/channel.rb

20 lines
512 B
Ruby
Raw Normal View History

# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
class Channel < ApplicationModel
store :options
2012-04-10 14:06:46 +00:00
def self.fetch
channels = Channel.where( 'active = ? AND area LIKE ?', true, '%::Inbound' )
channels.each { |channel|
2012-04-10 14:06:46 +00:00
begin
c = eval 'Channel::' + channel[:adapter] + '.new'
2012-04-10 14:06:46 +00:00
c.fetch(channel)
rescue Exception => e
puts "can't use " + 'Channel::' + channel[:adapter]
2012-04-10 14:06:46 +00:00
puts e.inspect
2013-05-25 11:36:01 +00:00
puts e.backtrace
2012-04-10 14:06:46 +00:00
end
}
end
end