start on accounts using site context, improved settings page, clean up space representation

This commit is contained in:
Kyle Drake 2014-10-07 02:22:08 +02:00
parent 8a36f1c6f5
commit d3c1546d45
17 changed files with 243 additions and 105 deletions

View file

@ -1,5 +1,15 @@
class Numeric
ONE_MEGABYTE = 1048576
def roundup(nearest=10)
self % nearest == 0 ? self : self + nearest - (self % nearest)
end
end
def to_mb
self/ONE_MEGABYTE.to_f
end
def to_space_pretty
"#{(self.to_f / ONE_MEGABYTE).round(2).to_s} MB"
end
end