Reputation: 329
I couldn't find in ar-octopus (https://github.com/tchandy/octopus) documentation, how can i perform a transaction.
When performing :
ActiveRecord::Base.connection.transaction do
Octopus.using(:shard, &block)
end
the code in the block isn't running in a transaction.
Please advise.
Upvotes: 3
Views: 624
Reputation: 121
Instead of passing &block you can do the following :
Octopus.using(:shard) do
ActiveRecord::Base.connection.transaction do
block.call
end
end
Upvotes: 4