refractor code into different files

This commit is contained in:
hitman 2017-03-06 23:54:29 +05:30 committed by Stella Rouzi
parent 8320f78d0b
commit 5dece1ea48
4 changed files with 75 additions and 38 deletions

View file

@ -195,5 +195,12 @@ module FormatHelper
def quantity_left_of(resource)
return '-/-' if resource.quantity.blank?
"#{resource.quantity - resource.used}/#{resource.quantity}"
def normalize_array_length(hashmap, length)
hashmap.each do |_, value|
if value.length < length
value.fill(value[-1], value.length...length)
end
end
end
end