Reputation: 526
I have two apps - A and B, which do different tasks on the same database.
It occurred to me that when I try to modify model (say x), I have to do the followings.
modify x.rb in app A and run tests.
replace x.rb in B with x.rb in A.
run tests in B and fail.
find errors in B.
apply to A.
Apparently, it sucks. Is there any good practice for this case?
Upvotes: 0
Views: 748
Reputation: 19
You can use an engine : http://guides.rubyonrails.org/engines.html
Engine have shared models for your x applications, if you modify one model each application will inherit the change.
In each app, you will add the references in gemfile :
gem 'my_engine', :path => 'engine_path_project'
and you can write test in the dummy application into the engine project.
Upvotes: 0