开发者

Rails - debugging functions

I am debugging a class which is structured like this

 class EmailQueue < ActiveRecord::Base
  logger = RAILS_DEFAULT_LOGGER  

  def self.poll_mail
   logger.info "Running Mail Importer..." 
   ContactMailer.receive(email.pop)
 .........

class ContactMailer < ActionMailer::Base 
 ENV['RAILS_ENV'] ||= 'development'
 logger = RAILS_DEFAULT_LOGGER

 def receive(email)
  logger.info "Processing Mail..."
 .......... 

The debug messages in email queue are outputted but the messages开发者_高级运维 in contactmailer are not outputted ?

ALex


def recieve(email)

is an instance method, so maybe try changing to:

def self.receive(email)

or try instantiating like so

mailer = ContactMailer.new
mailer.recieve(email.pop)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜