Project

General

Profile

Download (464 Bytes) Statistics
| Branch: | Tag: | Revision:
module ComputeResourceConsoleCommon
extend ActiveSupport::Concern

def set_console_password?
!(attrs[:setpw] == 0) # return true unless attrs[:setpw] is set to 0
end
alias_method :set_console_password, :set_console_password?

def set_console_password=(setpw)
if ['true', true, '1', 1].include?(setpw)
self.attrs[:setpw] = 1
else
self.attrs[:setpw] = 0
end
end

def name_sort(array)
array.sort_by{|a| a.name}
end
end
(8-8/46)