mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 06:42:32 -05:00
add submitter fields autocomplete
This commit is contained in:
1 parent
f1f4de53c6
commit
54592e7264
11 files changed
+182
-25
No files matched your search
@@ -3,6 +3,20 @@
|
||||
module Submitters
|
||||
module_function
|
||||
|
||||
def search(submitters, keyword)
|
||||
return submitters if keyword.blank?
|
||||
|
||||
term = "%#{keyword.downcase}%"
|
||||
|
||||
arel_table = Submitter.arel_table
|
||||
|
||||
arel = arel_table[:email].lower.matches(term)
|
||||
.or(arel_table[:phone].matches(term))
|
||||
.or(arel_table[:name].lower.matches(term))
|
||||
|
||||
submitters.where(arel)
|
||||
end
|
||||
|
||||
def select_attachments_for_download(submitter)
|
||||
original_documents = submitter.submission.template.documents.preload(:blob)
|
||||
is_more_than_two_images = original_documents.count(&:image?) > 1
|
||||
|
||||
Reference in new issue
Block a user