Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
norrismei committed Aug 29, 2024
1 parent dcab6f1 commit 419a86c
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions app/pdfs/picklists_pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class PicklistsPdf
include ItemsHelper

def initialize(organization, requests)
@requests = requests # does this need to be Request.includes(XXX).etc? Investigate.
@organization = organization# temporary for single picklist only
@requests = requests
@organization = organization
end

def compute_and_render
Expand All @@ -16,10 +16,10 @@ def compute_and_render

@requests.each do |request|
logo_image = if @organization.logo.attached?
StringIO.open(@organization.logo.download)
else
Organization::DIAPER_APP_LOGO
end
StringIO.open(@organization.logo.download)
else
Organization::DIAPER_APP_LOGO
end

# Bounding box containing non-footer elements
bounding_box [bounds.left, bounds.top], width: bounds.width, height: bounds.height - footer_height do
Expand Down Expand Up @@ -89,10 +89,10 @@ def compute_and_render
font_size 11

# Line item table
table(data, :width => bounds.width, :column_widths => { 1 => 65, -2 => 35 }) do
table(data, width: bounds.width, column_widths: {1 => 65, -2 => 35}) do
self.header = true
self.cell_style = { padding: [5, 10, 5, 10]}
self.row_colors = %w(dddddd ffffff)
self.cell_style = {padding: [5, 10, 5, 10]}
self.row_colors = %w[dddddd ffffff]

cells.borders = []

Expand All @@ -101,7 +101,7 @@ def compute_and_render
row(0).border_width = 2
row(0).font_style = :bold
row(0).size = 10
row(0).column(1..-1).borders = %i(bottom left)
row(0).column(1..-1).borders = %i[bottom left]
end
end

Expand All @@ -126,9 +126,9 @@ def compute_and_render
end

number_pages "Page <page> of <total>",
start_count_at: 1,
at: [bounds.right - 130, 22],
align: :right
start_count_at: 1,
at: [bounds.right - 130, 22],
align: :right

render
end
Expand Down Expand Up @@ -167,5 +167,3 @@ def data_no_units(items)
end
end
end


0 comments on commit 419a86c

Please sign in to comment.