Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-04 18:08:46 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-04 18:08:46 +0300
commitadf76f8f1d6da3ecbd8aa5d2da68dc8456283e8f (patch)
tree8f422d83a2690d0fdb3fd0ee55cf225e40fd976a /app/models/concerns/issuable.rb
parent6724a6ee6b0898470e20f294f1328cc01891756a (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/concerns/issuable.rb')
-rw-r--r--app/models/concerns/issuable.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb
index 46cd9649c2d..a6986029f0d 100644
--- a/app/models/concerns/issuable.rb
+++ b/app/models/concerns/issuable.rb
@@ -385,8 +385,12 @@ module Issuable
Date.today == created_at.to_date
end
+ def created_hours_ago
+ (Time.now.utc.to_i - created_at.utc.to_i) / 3600
+ end
+
def new?
- today? && created_at == updated_at
+ created_hours_ago < 24
end
def open?