0

I have seperated the models and DB directory to a separate shared repository from the source application repository in order to use this shared repostory as a library/shared directory with other applications.

I have implemented this by using subtrees but I could not access the schema.rb file which is now present in the shared directory created in the source application

have made changes in application.rb for accessing models, model concerns and db directory from the shared directory as below

config.paths['db'] << "#{root}/shared/db"
config.paths['app/models'] << "#{root}/shared/models"
config.paths.add("#{root}/shared/models/concerns", eager_load: true)

db directory contains "migrate" directory, schema.rb and seeds.rb

Models and its concerns are working fine but db directory cannot be accessed.

3
  • 1
    The question seems incomplete (the last sentence ends with a conjunction and no punctuation) and it's not clear whether Git has anything to do with this anyway. Is this really just a question about pointing Ruby to the correct schema.rb file? Commented May 26, 2022 at 7:43
  • Yes. ruby is not pointing to the schema.rb which is not inside root/shared/db directory Commented May 26, 2022 at 9:45
  • I don't use RoR so it's hard for me to be sure, but this line suggests you can just set some environment variables, or (nearby related lines) a config/database.yml file. Commented May 26, 2022 at 9:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.