channel.rb 533 B

1234567891011121314151617181920
  1. # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
  2. class Channel < ApplicationModel
  3. store :options
  4. def self.fetch
  5. channels = Channel.where( 'active = ? AND area LIKE ?', true, '%::Inbound' )
  6. channels.each { |channel|
  7. begin
  8. c = eval 'Channel::' + channel[:adapter] + '.new'
  9. c.fetch(channel)
  10. rescue Exception => e
  11. puts "can't use " + 'Channel::' + channel[:adapter]
  12. puts e.inspect
  13. puts e.backtrace
  14. c.disconnect
  15. end
  16. }
  17. end
  18. end