-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: _insert_record failed for other adapters (#298)
* fix: _insert_record failed for other adapters The _insert_record method would fail for adapters other than Spanner, as it would call super with two arguments. This is now changed so the method checks whether the current connection uses Spanner or some other adapter, and based on that calls the super method with 1 or 2 arguments. Fixes #292 * chore: fix rubocop issue * fix: also call correct super for spanner adapter
- Loading branch information
Showing
4 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
test/activerecord_spanner_mock_server/models/other_adapter.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Use of this source code is governed by an MIT-style | ||
# license that can be found in the LICENSE file or at | ||
# https://opensource.org/licenses/MIT. | ||
|
||
module MockServerTests | ||
class System < ActiveRecord::Base | ||
has_many :projects | ||
end | ||
|
||
class Plan < ActiveRecord::Base | ||
has_many :projects | ||
end | ||
|
||
class Project < ActiveRecord::Base | ||
belongs_to :system | ||
belongs_to :plan | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters