Class: Pacbio::SmrtLinkVersion
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Pacbio::SmrtLinkVersion
- Defined in:
- app/models/pacbio/smrt_link_version.rb
Overview
Pacbio::SmrtLinkVersion
Class Method Summary collapse
-
.default ⇒ Object
Returns the default SMRT Link version.
Instance Method Summary collapse
-
#default_options ⇒ Hash
each key is the option key and the value is the default value if the default value is nil then it is not included.
Class Method Details
.default ⇒ Object
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_options ⇒ Hash
each key is the option key and the value is the default value if the default value is nil then it is not included
23 24 25 26 27 28 29 |
# File 'app/models/pacbio/smrt_link_version.rb', line 23 def {}.tap do || .where.not(default_value: nil).find_each do |option| [option.key] = option.default_value end end end |