Forum: Ruby on Rails problem in backgroundrb

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.
0b119a0054ac02e180950a8d247a4fbe?d=identicon&s=25 selvaraj (Guest)
on 2007-03-12 11:23
Here my code

  class SendMessageWorker < BackgrounDRb::Worker::RailsBase

  def do_work(args)
    # This method is called in it's own new thread when you
    # call new worker. args is set to :args
    @sms2=SendMessageDetail.find_by_send_message_id(args)
       @sms2.each do |send_msg| @sms2
        .
        .
        ...
        some of  my logic
      end

problem is for loop..
  if i excute this code,,   its telling each is undifined methiod.

If i am executing without for loop its working fine.


please help me......
94c40fd67ffecc80b479aa9d7df3c494?d=identicon&s=25 Jonathan del Strother (Guest)
on 2007-03-12 11:49
(Received via mailing list)
On 12 Mar 2007, at 10:23, selvaraj wrote:

>         .
>         .
>         ...
>         some of  my logic
>       end
>
> problem is for loop..
>   if i excute this code,,   its telling each is undifined methiod.
>
> If i am executing without for loop its working fine.

I think you want find_*all*_by_send_message_id
0b119a0054ac02e180950a8d247a4fbe?d=identicon&s=25 selvaraj (Guest)
on 2007-03-12 11:55
Jonathan del Strother wrote:
> On 12 Mar 2007, at 10:23, selvaraj wrote:
>
>>         .
>>         .
>>         ...
>>         some of  my logic
>>       end
>>
>> problem is for loop..
>>   if i excute this code,,   its telling each is undifined methiod.
>>
>> If i am executing without for loop its working fine.
>
> I think you want find_*all*_by_send_message_id

  ya i got it.

many thanks for yr reply
This topic is locked and can not be replied to.