rearrange helper functions

This commit is contained in:
hitman 2017-03-10 02:18:26 +05:30 committed by Stella Rouzi
parent f63259f187
commit 5b1a730e19
5 changed files with 30 additions and 71 deletions

View file

@ -192,11 +192,8 @@ module FormatHelper
markdown("#{text} Please look at #{link_to '**Markdown Syntax**', 'https://daringfireball.net/projects/markdown/syntax', target: '_blank'} to format your text")
end
def normalize_array_length(hashmap, length)
hashmap.each do |_, value|
if value.length < length
value.fill(value[-1], value.length...length)
end
end
def quantity_left_of(resource)
return '-/-' if resource.quantity.blank?
"#{resource.quantity - resource.used}/#{resource.quantity}"
end
end