Fix 2.4.2 upgrade notes formatting refs #19330
[arvados.git] / apps / workbench / app / models / container_request.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 class ContainerRequest < ArvadosBase
6   def self.creatable?
7     false
8   end
9
10   def textile_attributes
11     [ 'description' ]
12   end
13
14   def self.goes_in_projects?
15     true
16   end
17
18   def self.copies_to_projects?
19     false
20   end
21
22   def work_unit(label=nil, child_objects=nil)
23     ContainerWorkUnit.new(self, label, self.uuid, child_objects=child_objects)
24   end
25
26   def editable_attributes
27     super + ["reuse_steps"]
28   end
29
30   def reuse_steps
31     command.each do |arg|
32       if arg == "--enable-reuse"
33         return true
34       end
35     end
36     false
37   end
38
39   def self.attribute_info
40     self.columns
41     @attribute_info[:reuse_steps] = {:type => "boolean"}
42     @attribute_info
43   end
44
45 end