Invoke rake task from ActiveRecord observer

Posted by auralbee on Stack Overflow See other posts from Stack Overflow or by auralbee
Published on 2010-06-11T09:53:26Z Indexed on 2010/06/11 10:02 UTC
Read the original article Hit count: 196

Filed under:
|
|

Can I do the following?

def ModelObserver < ActiveRecord

   def after_save
     Rake::Task[name].invoke
   end

end

At the moment, this returns the following error:

Don't know how to build task 'name'

Any idea?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby