Skip to content
This repository was archived by the owner on Sep 12, 2022. It is now read-only.

Conversation

@CedricCouton
Copy link
Owner

workerB

CouchbaseOrm.logger.debug "Data - Get #{id}"
!bucket.get(id, quiet: true).nil?
CouchbaseOrm.logger.debug "Data - Exists? #{id}"
collection.exists(id).exists
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a exists? method in collection

alias_method :has_key?, :exists?
end

class MismatchTypeError < RuntimeError; end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surement à supprimer

def touch(**options)
CouchbaseOrm.logger.debug "Data - Touch #{@__metadata__.key}"
res = self.class.bucket.touch(@__metadata__.key, async: false, **options)
res = self.class.collection.touch(@__metadata__.key, async: false, **options)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace all **options by encapsulating them with Options

else
false
end
records = quiet ? collection.get_multi(ids) : collection.get_multi!(ids)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should pass option to get_multi

nil
end

def get_multi!(*ids, **options)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should add a test where first id is valid but not second


# Clean up record if the id doesn't exist
self.bucket.delete(key, quiet: true)
self.collection.remove(key)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't destruct db on a finder ⚠️

@CedricCouton CedricCouton force-pushed the activemodel7-couchbase-ruby-client branch from 0fd05cc to 922dbb8 Compare September 8, 2022 20:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants