[英]Rails - debugging functions
我正在調試這樣的結構的類
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中的消息未輸出?
艾力克斯
def recieve(email)
是實例方法,所以也許嘗試更改為:
def self.receive(email)
或嘗試像這樣實例化
mailer = ContactMailer.new
mailer.recieve(email.pop)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.