Kyrre Nygård wrote:
I'm trying to join two Rails apps, namely Beast and Simplelog.
It is important that things remain neat and supersimple, otherwise I'll feel sick.
I'm not quite sure what exactly you want to achieve (single sign on, single database, single codebase or a combination) but none of these is supersimple probably also won't be neat.
Having a single database would be the easiest one (besides SSO if the apps support openid out of the box). You would have to compare the tables created by both apps to make sure that there are no duplicates. Then it would be as simple as pointing both configs to the same db. The only thing that will break is migrations support since the schema version is stored in the db as well. You can always go in and manually edit the schema version number though.. If there are duplicate table names, you would need obviously need to override them.
Now if you would REALLY want to merge codebase and have a single database, the way to go might be to namespace all your ruby classes into e.g. Beast and Simplelog. Then you create a Application::Base < ActiveRecord::Base class for each app and use this base class to prefix all your tables with e.g. beast_ or simplelog_. Of course you then have to go prefix your routes as well.
I've never looked at the codebase of these applications but in theory this would be a fairly low-mess approach, even upgrades should be relatively painless if all you've done is prefix your routes and introduce a new base class for all models. Clearly though, YMMV and of course the question remains: why?