So I'd like to share models between two Rails apps and do not like the submodules solution (burned me in the past). I'm thinking about using gems to solve this and have this basically working:
- Create a gem using jeweler (my_models)
- Create a rails app with something in the Gemfile like:
gem 'my_models', :path => '../my_models'
so you can avoid constantly packaging the gem, etc. - Use shotgun to constantly reload all the classes (otherwise you can't really edit my_models files without restarting the server/console each time.
So a few questions:
- Shotgun is slow, is there a better way in Rails to reload just that one gem each time?
- If my my_models ActiveRecord models have dependencies, I put them in my_models gems, will that cause dependency nightmares in my regular app?
- What else am I missing on why this could be a bad idea?