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)
精彩评论