Hi everyone,
I believe I’ve found a solution after reading a great discussion in this forum.
To properly share relations across slices, the slice should not have its own db
folder. You can achieve this by generating the slice with the --skip-db
option:
hanami generate slice web --skip-db
Additionally, it’s necessary to enable relation sharing by configuring the application to import database settings from the parent:
module MyApp
class App < Hanami::App
config.db.import_from_parent = true
end
end
Does this approach align with best practices, or am I unintentionally relying on a side effect?
Any feedback or recommendations would be greatly appreciated!