Module: OscMacheteRails::Statusable::ClassMethods

Defined in:
lib/osc_machete_rails/statusable.rb

Overview

class methods to extend a model with

Instance Method Summary collapse

Instance Method Details

#activeObject

scope to get all of the jobs that are in an active state or have a pbsid



86
87
88
89
90
91
92
93
# File 'lib/osc_machete_rails/statusable.rb', line 86

def active
  # FIXME: what about OR i.e. where
  #
  #     status in active_values OR (pbsid != null and status == null)
  #
  # will need to use STRING for the sql instead of this.
  where(status: OSC::Machete::Status.active_values.map(&:char))
end