Class: Pacbio::SmrtLinkVersion

Inherits:
ApplicationRecord show all
Defined in:
app/models/pacbio/smrt_link_version.rb

Overview

Pacbio::SmrtLinkVersion

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.defaultObject

Returns the default SMRT Link version.



32
33
34
35
36
# File 'app/models/pacbio/smrt_link_version.rb', line 32

def self.default
  find_by(default: true,
          active: true) || raise('There is no default SMRT Link Version.
          Please create one or Traction will implode.')
end

Instance Method Details

#default_optionsHash

each key is the option key and the value is the default value if the default value is nil then it is not included

Returns:

  • (Hash)

    default options for this version



23
24
25
26
27
28
29
# File 'app/models/pacbio/smrt_link_version.rb', line 23

def default_options
  {}.tap do |options|
    smrt_link_options.where.not(default_value: nil).find_each do |option|
      options[option.key] = option.default_value
    end
  end
end