I need find a way to load all the models and their dependencies, but
no controllers, views, etc into a program that's not Rails. Any hints
on a good way to do this would be appreciated.
So far, I've looked at the ActiveSupport additions to Module, and had
a look around how script/server starts up.
thanks
John
I need find a way to load all the models and their dependencies, but
no controllers, views, etc into a program that's not Rails. Any hints
on a good way to do this would be appreciated.
So far, I've looked at the ActiveSupport additions to Module, and had
a look around how script/server starts up.
This is more a question for the users list than this one. However you
can simply require the relevant files and call establish_connection
yourself. Everything should work.
> I need find a way to load all the models and their dependencies, but
> no controllers, views, etc into a program that's not Rails. Any hints
> on a good way to do this would be appreciated.
> So far, I've looked at the ActiveSupport additions to Module, and had
> a look around how script/server starts up.
This is more a question for the users list than this one.
Yeah, my post isn't exactly about Rails development, but I felt it was
more likely that someone here would have a good answer.
However you
can simply require the relevant files and call establish_connection
yourself. Everything should work.
I tried that, but I run into problems with dependencies, in the sense
that certain models depend on others, and some models need acts_as_xxx
plugins and access to files that live in the lib/ subdirectory.
Obviously Rails deals with those issues, and I was hoping to make use
of whatever Rails does rather than rediscovering the techniques and
writing code that's already been written.
bye
John
The interplay of all these bits and pieces is handled by the railties
initializer. So you could probably sit down and figure out what's
going on and extract your own subset of it.
That's what I needed to know. Thanks.
bye
John