Using Rails config /load path/etc from external app

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

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.

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs