Skip to content

Instantly share code, notes, and snippets.

@dallarosa
Created January 18, 2011 04:28
Show Gist options
  • Save dallarosa/783986 to your computer and use it in GitHub Desktop.
Save dallarosa/783986 to your computer and use it in GitHub Desktop.
#METHOD CALLING THE DELAYED_JOB
def start
@user = User.find(params[:user_id])
@project = @user.projects.find(params[:project_id])
Delayed::Job.enqueue(TextAnalysis.new(@project.tasks.find(22)))
flash[:notice] = "Processing"
redirect_to :action => "show"
#CLASS DEFINITION
class TextAnalysis < Struct.new(:task)
def perform
task.status = 1
task.save
morph_analysis() #
.
.
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment