Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lib/microsoft_graph/base_entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ def save!
true
end

# update entity by specified hash
def update_attributes(raw:)
raise NoAssociationError unless parent
raise_no_graph_error! unless graph
if persisted?
graph.service.patch(path, raw.to_json)
else
initialize_serialized_properties(
graph.service.post(parent.path, to_json(convert_to_camel_case: true))
)
@persisted = true
end
mark_clean
true
end

def save
save!
rescue OData::HTTPError
Expand Down