Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Fix Mapotempo/couchbase-orm/issues/71 #25

Merged
merged 1 commit into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/couchbase-orm/persistence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def reload

CouchbaseOrm.logger.debug "Data - Get #{id}"
resp = self.class.collection.get!(id)
assign_attributes(decode_encrypted_attributes(resp.content.except("id"))) # API return a nil id
assign_attributes(decode_encrypted_attributes(resp.content.except("id", *self.class.ignored_properties ))) # API return a nil id
@__metadata__.cas = resp.cas

reset_associations
Expand Down
4 changes: 4 additions & 0 deletions spec/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ class InvalidNested < CouchbaseOrm::NestedDocument
from(%w[deprecated_property job name type]).
to(%w[job name type])
end

it 'does not raise for reload' do
expect{ loaded_model.reload }.not_to raise_error
end
end
end
end