I need to have a daemon read from and write to the database, and it
would be nice to be able to use ActiveRecord and all the model/* files
from my rails project rather than doing things the long way. Is there
any recommended strategy for that?
I’ve done something similar. I have a “server” which import some
information about images which needs some manipulation, then a client
which reads the db and does the manipulation. The client and server
are executed from crontab using script/runner:
script/runner ‘require “my_script.rb”’
This way I don’t have to include the models etc. into the scripts.
regards
Claus