Forum: Ruby on Rails Using Rails config /load path/etc from external app..

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.
Brez! !. (Guest)
on 2007-01-10 11:10
Kind of an off the wall question but I want to use the config / load
path [for models specifically] in an external app that essentially loads
the database for my rails app [there's transformations, processing
involved, i.e. fixtures won't help here] - it true DYI spirit, could
anyone suggest a way to effectively use the models/config in a seperate
script without having to restate them? I checked in the Rail Initializer
but didn't have much luck..

Thanks
Michael G. (Guest)
on 2007-01-10 14:22
Brez! !! wrote:
> Kind of an off the wall question but I want to use the config / load
> path [for models specifically] in an external app that essentially loads
> the database for my rails app [there's transformations, processing
> involved, i.e. fixtures won't help here] - it true DYI spirit, could
> anyone suggest a way to effectively use the models/config in a seperate
> script without having to restate them? I checked in the Rail Initializer
> but didn't have much luck..
>
> Thanks

script/runner 'load "db/fill_user_table.rb"'

Normally script/runner just executes the code passed to it, pass it a
file to execute.  I think this will work.
Brez! !. (Guest)
on 2007-01-10 21:13
>
> script/runner 'load "db/fill_user_table.rb"'
>
> Normally script/runner just executes the code passed to it, pass it a
> file to execute.  I think this will work.

Works like a charm - thanks..
This topic is locked and can not be replied to.