2011-02-08 72 views
0

我調試它的結構是這樣導軌 - 調試功能

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..." 
.......... 

在郵件隊列中的調試信息輸出,但在contactmailer消息不被輸出的類?

亞歷

回答

0
def recieve(email) 

是一個實例方法,所以也許嘗試更改爲:

def self.receive(email) 

或嘗試實例,像這樣

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