Skip to content

Commit f56d399

Browse files
authored
simplify has_one adapter logic (#86)
* Revert "simplify has_one adapter logic (#85)" This reverts commit 1bfc30a. * bump version
1 parent 1bfc30a commit f56d399

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/jsonapi_compliable/adapters/active_record_sideloading.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def has_one(association_name, scope: nil, resource:, foreign_key:, primary_key:
5858
parent.association(association_name).loaded!
5959
relevant_child = children.find { |c| c.send(foreign_key) == parent.send(primary_key) }
6060
next unless relevant_child
61-
parent.send(:"#{association_name}=", relevant_child)
61+
parent.association(association_name).replace(relevant_child, false)
6262
end
6363
end
6464

lib/jsonapi_compliable/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module JsonapiCompliable
2-
VERSION = "0.11.11"
2+
VERSION = "0.11.12"
33
end

0 commit comments

Comments
 (0)