Skip to content

Commit

Permalink
Checking missing singatures logic update
Browse files Browse the repository at this point in the history
  • Loading branch information
luciajanikova committed Oct 28, 2024
1 parent ef40ec0 commit 6da4232
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def message_thread_policy_scope
end

def any_missing_signature?(message_threads)
message_threads.any? { |thread| thread.any_objects_with_requested_signature? }
MessageThreadsTag.where(message_thread: message_threads, tag: Current.tenant.tags.signature_requesting).exists?
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def authorized?
end

def any_objects_with_requested_signature?
objects.any? { |message_object| message_object.tags.where(type: SignatureRequestedFromTag.to_s).any? }
MessageObjectsTag.where(message_object: objects, tag: tenant.tags.signature_requesting).exists?
end

# TODO remove UPVS stuff from core domain
Expand Down
4 changes: 0 additions & 4 deletions app/models/message_thread.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@ def unassign_tag(tag)
message_threads_tags.find_by(tag: tag)&.destroy
end

def any_objects_with_requested_signature?
tags.signature_requesting.any?
end

private

def has_tag?(tag)
Expand Down

0 comments on commit 6da4232

Please sign in to comment.