app/models/printer.rb
# Returns distinct printers with active print jobs.
Returns distinct printers with active print jobs.
Returns distinct printers with active print jobs .
def active
      joins(:prints).
        where(id: Print.active.select(:printer_id)).
        distinct
    end
def active joins ( :prints ) . where ( id : Print . active . select ( :printer_id ) ) . distinct end
Returns distinct printers with active print jobs.
Returns distinct printers with active print jobs .