Class: Labimotion::ElementKlass
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- Labimotion::ElementKlass
- Includes:
- GenericKlass, GenericKlassRevisions, MetadataValidation, Workflow
- Defined in:
- lib/labimotion/models/element_klass.rb
Class Method Summary collapse
Methods included from Workflow
#migrate_workflow, #split_workflow
Methods included from GenericKlassRevisions
#check_identifier, #create_klasses_revision
Class Method Details
.gen_klasses_json ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/labimotion/models/element_klass.rb', line 30 def self.gen_klasses_json klasses = where(is_active: true, is_generic: true).order('place')&.pluck(:name) || [] rescue ActiveRecord::StatementInvalid, PG::ConnectionBad, PG::UndefinedTable klasses = [] ensure File.write( # Rails.root.join('app/packs/klasses.json'), Labimotion::KLASSES_JSON, klasses&.to_json || [] ) end |