Merge branch '9684-workflows'
[arvados.git] / apps / workbench / app / models / virtual_machine.rb
1 class VirtualMachine < ArvadosBase
2   attr_accessor :current_user_logins
3
4   def self.creatable?
5     false
6   end
7
8   def attributes_for_display
9     super.append ['current_user_logins', @current_user_logins]
10   end
11
12   def editable_attributes
13     super - %w(current_user_logins)
14   end
15
16   def self.attribute_info
17     merger = ->(k,a,b) { a.merge(b, &merger) }
18     merger [nil,
19             {current_user_logins: {column_heading: "logins", type: 'array'}},
20             super]
21   end
22
23   def friendly_link_name lookup=nil
24     (hostname && !hostname.empty?) ? hostname : uuid
25   end
26 end