Method: Jamf::Prestage::ClassMethods#default
- Defined in:
- lib/jamf/api/jamf_pro/mixins/prestage.rb
#default ⇒ Jamf::Prestage?
Return the Prestage that is marked as default, i.e. the one that new SNs are assigned to when first added. Nil if no default is defined
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/jamf/api/jamf_pro/mixins/prestage.rb', line 61 def default # only one can be true at a time, so sort desc by that field, # and the true one will be at the top default_prestage_data = all.select { |d| d[:defaultPrestage] }.first # Just in case there was no true one, make sure defaultPrestage is true return unless default_prestage_data&.dig(:defaultPrestage) fetch id: default_prestage_data[:id] end |