Forum: Ruby on Rails Instance methods in runner?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
8c49880a7f274947b01d576c5828a5f6?d=identicon&s=25 Lon Baker (spdemac)
on 2006-02-27 03:33
(Received via mailing list)
I am having a devil of a time with some runner actions.

I can not seem to call any instance methods on found records.

Even when I strip is down to the basics:

def self.deliver
     self.find(:all, :conditions => ["#{Message.table_name}.status
= ?", 'pending'], :include => [:site, :template]).each {|m| m.is_recurring? # my method m.new_record? # ar method

Both logger entries show black lines in the logger.

Nothing seems to work.

This object uses STI, could that be the problem?

Lon Baker
AIM: spdemac
8e44c65ac5b896da534ef2440121c953?d=identicon&s=25 Ezra Zygmuntowicz (Guest)
on 2006-02-27 05:43
(Received via mailing list)
On Feb 26, 2006, at 6:33 PM, Lon Baker wrote:

> m.new_record? # ar method
>       }
> end

def self.deliver
     find(:all, :conditions => ["#{Message.table_name}.status = ?",
'pending'], :include => [:site, :template]).each {|m| m.is_recurring? # my method m.new_record? # ar method

Try that instead. If that doesn't work try self.class.find :all ...

This topic is locked and can not be replied to.