Forum: Ruby on Rails database access from outside rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ae16cb4f6d78e485b04ce1e821592ae5?d=identicon&s=25 Martin DeMello (Guest)
on 2006-03-22 11:45
(Received via mailing list)
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
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-03-22 12:02
(Received via mailing list)
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.
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Mikkel Bruun (Guest)
on 2006-03-22 12:03
(Received via mailing list)
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
>Rails@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails


Mikkel Bruun

www.strongside.dk    - Football Portal(DK)
nflfeed.helenius.org - Football News(DK)
ting.minline.dk      - Buy Old Stuff!(DK)
B8d11b4c89cfc6e34d6c9fb121c9acac?d=identicon&s=25 Claus Guttesen (Guest)
on 2006-03-22 12:04
(Received via mailing list)
> 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
This topic is locked and can not be replied to.