From bf64a59649d273e77572521791722d99f3fc1fda Mon Sep 17 00:00:00 2001 From: Georg G Date: Tue, 5 Jan 2016 20:54:13 +0100 Subject: [PATCH] added User#can_export? --- app/models/user.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index 507821ea..8f239716 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -251,4 +251,8 @@ class User < ActiveRecord::Base self.update(permanently_banned: false, banned_until: buntil, ban_reason: reason) end end + + def can_export? + !self.export_processing? && !self.export_created_at.nil? && Time.now > self.export_created_at.in(1.week) + end end