On Tue, 2009-08-18 at 13:25 +0900, Elizabeth wrote:
> I've been Googling this topic, and I haven't found the answer.
> 
> In Rails, the Models are defined in external files.  How do you use
> externally defined models in Ruby using ActiveRecord.  I have a rails
> app and a ruby app which will share the model definitions.  I want to
> use the DRY technique, so I don't want to define them both in the
> models directory and inside the Ruby application.

I did that by writing a small script that simply copies all models from
rails, puts them into a namespace and generates an initial 'require
file' to autoload them in a rubygems environment.
On the target system then I just install the gem and can reuse all
models in any ruby script.
If models are changed I run that script again and get a new version of
the gem.

Martin



> Thanks in advance,
> Elizabeth