Class: BackgroundPrinterJob

Inherits:
OxJob
  • Object
show all
Defined in:
app/jobs/background_printer_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(job, *args) ⇒ Object

[#<PrintJob id: 28, account_id: 1, printer_id: 7, printed_by_id: 1, printed_by_type: “User”, view_template_path: “/record.html.haml”,

 name: "Account print at 13-10-2015", printing_class: "Account", print_driver: "pdf", print_format: "sheet", state: "drafted",
 paper: "A4", copies: 1, print_sql: "SELECT `accounts`.* FROM `accounts` WHERE (`accoun...", created_at: "2015-10-13 14:19:10",
 updated_at: "2015-10-13 14:19:10">, {:queue=>"printing", :account_id=>1}, {:account_id=>1}
]


9
10
11
12
# File 'app/jobs/background_printer_job.rb', line 9

def perform job, *args
  job.update_column :state, I18n.t( "#{job.class.to_s.underscore.pluralize}.performing")
  job.perform args
end