Sha256: 48e6c8cf944c1885fb2bef9ee9e61c310012e46c876499f407e22a08f13581e6
Contents?: true
Size: 585 Bytes
Versions: 12
Compression:
Stored size: 585 Bytes
Contents
module Admin::JobsHelper def seconds_in_short(seconds) seconds = seconds.to_i minutes = seconds / 60 hours = seconds / (60 * 60) days = seconds / (60 * 60 * 24) if days > 0 return "#{days} d" elsif hours > 0 return "#{hours} h" elsif minutes > 0 return "#{minutes} m" else return "#{seconds} s" end end def time_ago_in_words_with_customization(time) if time "#{time_ago_in_words(time)} ago" else "n/a" end end def downloadable?(job) job.result.respond_to?(:join) end end
Version data entries
12 entries across 12 versions & 2 rubygems