On Aug 15, 1:10 pm, Genji <[email protected]> wrote:
> Hi all,
>
> I wrote a simple code to set up the "pit_id" from a village table from
> 1 to 2, from 2 to 3 and so on.
> It works fine without .delay . But i need it so whats wrong with that
> code?
>
> #village_controller
>   def post_info
>     @village = Village.find(params[:id])
>     @village.delay.upgrade
>     flash[:notice] = "Upgrading"
>     redirect_to village_url(@village)
>   end
>
> #village.rb
>   def upgrade
>     sleep 3
>     update_attribute(:pit_id, pit_id + 1)
>   end
>
> I've heard that there could be problems with the variables when using
> delay ?
>

In what way does it not work ?

Fred
> I already tried @village.delay.upgrade(@village)

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to