I presently am refactoring an a Rails App that has not only the
standard RoR web front end, but also agents which share the same model
and run on different machines. In the past the whole rails app was
just deployed on other machines even though only the model was used. I
am trying to improve the situation by extracting the model into a gem
which depends only on ActiveRecord and then requiring the model gem in
both my rails application and the agent.
I am finding that my new model gem has a very similar structure to the
rails app with some of the same pieces as the rails app, e.g. boot.rb,
environment.rb, test_helper.rb, etc, albeit scaled down to just the
ActiveRecord specific material. Perhaps this would be a good candidate
for a generator eventually.
One interesting by-product of this approach is that I expect my
fixture data to be easier to maintain since instead of having fixtures
for the unit tests, functional tests for the web, and tests for the
agent all in the same files, these will naturally be broken down into
three separate projects.
In any case I am wondering if anyone else has travelled this road
before and has any experiences they’d like to relate. Did it work
pretty well over the long haul or should I turn back now?
Pearson Educational Measurement
2510 North Dodge St.
Iowa City, IA 52245