Forum: Ruby on Rails Instance methods in runner?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Lon B. (Guest)
on 2006-02-27 04: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|
	logger.info m.is_recurring? # my method
	logger.info m.new_record? # ar method
       }
end

Both logger entries show black lines in the logger.

Nothing seems to work.

This object uses STI, could that be the problem?

--
Lon B.
http://www.speedymac.com
AIM: spdemac
Ezra Z. (Guest)
on 2006-02-27 06:43
(Received via mailing list)
On Feb 26, 2006, at 6:33 PM, Lon B. wrote:

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


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



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


-Ezra
This topic is locked and can not be replied to.