BufferedMutation breaks after_xxx hooks. #177
Labels
api: spanner
Issues related to the googleapis/ruby-spanner-activerecord API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Problem
activerecord-spanner-adapter breaks ActiveRecord's after_xxx hooks.
Perhaps this is a problem caused by BufferedMutation.
Like codes shows in bellow, I am unable to retrieve the record in the
after_save
block immediately after insertion.I doubt that this similar problem is also happening in
after_update
andafter_create
.Solution(?)
I do not have a idea to monkey-patch for this problem.
My only solution was to remove
require "activerecord_spanner_adapter/base"
from lib.ruby-spanner-activerecord/lib/active_record/connection_adapters/spanner_adapter.rb
Line 23 in 07f5b6c
Reproduce
sample code:
output:
This is expected output by using MySQL or remove
require "activerecord_spanner_adapter/base"
from lib.The text was updated successfully, but these errors were encountered: