Skip to content
Merged
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/relation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def [](*args)
def delete_all
CouchbaseOrm::logger.debug{ "Delete all: #{self}" }
ids = query.to_a
CouchbaseOrm::Connection.bucket.default_collection.remove_multi(ids) unless ids.empty?
@model.bucket.default_collection.remove_multi(ids) unless ids.empty?

Choose a reason for hiding this comment

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

medium

The unless ids.empty? check is unnecessary. The Couchbase SDK's remove_multi method handles an empty array of IDs gracefully by performing a no-op. Removing this conditional check simplifies the code and relies on the idiomatic behavior of the SDK.

                @model.bucket.default_collection.remove_multi(ids)

end

def where(string_cond=nil, **conds)
Expand Down