fix rubocop
This commit is contained in:
@@ -4,7 +4,7 @@ module Templates
|
||||
module DetectFields
|
||||
module_function
|
||||
|
||||
TextFieldBox = Struct.new(:x, :y, :w, :h, keyword_init: true) do
|
||||
TextFieldBox = Struct.new(:x, :y, :w, :h) do
|
||||
def endy
|
||||
@endy ||= y + h
|
||||
end
|
||||
@@ -14,7 +14,7 @@ module Templates
|
||||
end
|
||||
end
|
||||
|
||||
PageNode = Struct.new(:prev, :next, :elem, :page, :attachment_uuid, keyword_init: true)
|
||||
PageNode = Struct.new(:prev, :next, :elem, :page, :attachment_uuid)
|
||||
|
||||
DATE_REGEXP = /
|
||||
(?:
|
||||
|
||||
@@ -4,7 +4,7 @@ module Templates
|
||||
module ImageToFields
|
||||
module_function
|
||||
|
||||
Field = Struct.new(:type, :x, :y, :w, :h, :confidence, keyword_init: true) do
|
||||
Field = Struct.new(:type, :x, :y, :w, :h, :confidence) do
|
||||
def endy
|
||||
@endy ||= y + h
|
||||
end
|
||||
|
||||
@@ -34,7 +34,7 @@ module Templates
|
||||
|
||||
if index.positive? && pdf_fields.present?
|
||||
preview_document = template.schema[index - 1]
|
||||
preview_document_last_field = template.fields.reverse.find do |f|
|
||||
preview_document_last_field = template.fields.rfind do |f|
|
||||
f['areas']&.any? do |a|
|
||||
a['attachment_uuid'] == preview_document[:attachment_uuid]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user