Closed MasanoriOnishi closed 3 years ago
This is not a bug. The Repository
class doesn't have access to gateway
. I think we could use keywords for providing a gateway and change its default value in Repository::Root
. I'll send a PR today but it'll be a breaking change so 6.0 only. In the meantime, you can define your own method for using transactions, nothing really depends on the default implementation.
In the same case I just redefined #transaction
method in my root repository.
Describe the bug
I use the code following this, to realize multiple database connection.
And I want to use transaction for both gateway. However, due to the following code, I can use transaction only for
default
gateway. https://github.com/rom-rb/rom/blob/master/lib/rom/repository.rb#L151To Reproduce
Expected behavior
We can use transaction for each gateway in the use of multiple database connection.
https://github.com/rom-rb/rom/blob/master/lib/rom/repository.rb#L151
I think I want to fix the code in the following way.
before
after
My environment