views:

188

answers:

2

I want to execute a rake script from within a model. Beside calling it via backtick, is there anyway to include the rake library and call Rake::Task['some_task'].invoke.

+5  A: 

I know this doesn't answer your question directly, but if it's shared code why not make it a module? You'd avoid duplication and be able to use it wherever you need to.

Andy Gaskell
+2  A: 

you can use 'system' to run it, but I agree with Andy, it should be shared to avoid duplication

penger