Database access from outside rails

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?

martin

Martin DeMello wrote:

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?
script/runner is quite handy for that.

search the wiki…

its pretty simple to do…

On Wednesday, March 22, 2006, at 4:14 PM, Martin DeMello wrote:

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?

martin


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

Mikkel B.

www.strongside.dk - Football Portal(DK)
nflfeed.helenius.org - Football News(DK)
ting.minline.dk - Buy Old Stuff!(DK)

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