Skip to content

Commit 4a4f757

Browse files
coreywardsenid231
authored andcommitted
Exclude path params from attributes hash
1 parent 3f36f74 commit 4a4f757

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/json_api_client/resource.rb

+8-1
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,15 @@ def association_for(name)
494494
end
495495
end
496496

497+
def non_serializing_attributes
498+
[
499+
self.class.read_only_attributes,
500+
self.class.prefix_params.map(&:to_s)
501+
].flatten
502+
end
503+
497504
def attributes_for_serialization
498-
attributes.except(*self.class.read_only_attributes).slice(*changed)
505+
attributes.except(*non_serializing_attributes).slice(*changed)
499506
end
500507

501508
def relationships_for_serialization

0 commit comments

Comments
 (0)