diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 151495f..61f60a8 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -5,6 +5,7 @@ module ApplicationHelper options[:nocomment] = true options[:variant] ||= :outline #options[:class] = options.fetch(:class, nil) + options[:class] = "size-5" unless options[:class] path = options.fetch(:path, "icons/#{options[:variant]}/#{name}.svg") icon = path inline_svg_tag(icon, options) diff --git a/app/models/job.rb b/app/models/job.rb index eb2f999..9da1b8c 100644 --- a/app/models/job.rb +++ b/app/models/job.rb @@ -1,6 +1,6 @@ class Job < ApplicationRecord - belongs_to :operator, class_name: 'User', optional: true - belongs_to :costumer, class_name: 'User', optional: true + belongs_to :operator, class_name: "User", optional: true + belongs_to :costumer, class_name: "User", optional: true has_one_attached :pdf, dependent: :purge @@ -29,11 +29,11 @@ class Job < ApplicationRecord scope :created_today, -> { created_on_day(Time.now) } scope :created_on_day, lambda { |date| - where('created_at >= ? AND created_at <= ?', date.beginning_of_day, date.end_of_day) + where("created_at >= ? AND created_at <= ?", date.beginning_of_day, date.end_of_day) } scope :upgraded_today, -> { upgraded_on_day(Time.now) } scope :upgraded_on_day, lambda { |date| - where('upgraded_at >= ? AND upgraded_at <= ?', date.beginning_of_day, date.end_of_day) + where("upgraded_at >= ? AND upgraded_at <= ?", date.beginning_of_day, date.end_of_day) } # Returns all jobs with status: open print ready_for_pickup and jobs from today with status: paid canceled # paid: only updated_at today @@ -42,7 +42,7 @@ class Job < ApplicationRecord # NOTE: use Time.now instead of Date.today to take the timezone into account where(status: %i[open printing ready_for_pickup]) .or(Job.where(status: %i[paid canceled]) - .where('status_changed_at >= ?', Time.now.beginning_of_day)) + .where("status_changed_at >= ?", Time.now.beginning_of_day)) # .in_status_order .order(created_at: :desc) .order(:costumer_firstname, :costumer_lastname) @@ -50,17 +50,17 @@ class Job < ApplicationRecord # .references(:pdf_attachment, :blob) # creates big join table end - def fullname - [costumer_firstname, ' ', costumer_lastname].join + def costumer_fullname + [ costumer_firstname, " ", costumer_lastname ].join end def acceptable_pdf return unless pdf.attached? - acceptable_types = ['application/pdf'] + acceptable_types = [ "application/pdf" ] - errors.add(:pdf, 'is too big') unless pdf.blob.byte_size <= 100.megabyte - errors.add(:pdf, 'must be a PDF') unless acceptable_types.include?(pdf.content_type) + errors.add(:pdf, "is too big") unless pdf.blob.byte_size <= 100.megabyte + errors.add(:pdf, "must be a PDF") unless acceptable_types.include?(pdf.content_type) end def able_to_cancel? diff --git a/app/views/jobs/_job_tr.html.erb b/app/views/jobs/_job_tr.html.erb index 33fbe87..2ff2f27 100644 --- a/app/views/jobs/_job_tr.html.erb +++ b/app/views/jobs/_job_tr.html.erb @@ -2,10 +2,10 @@