FEATURE: Display 'last updated' on dashboard, improve release notes link (#7560)

This commit is contained in:
David Taylor
2019-05-17 06:42:45 +01:00
committed by Sam
parent 834c86678f
commit 5666316285
7 changed files with 28 additions and 12 deletions

View File

@@ -437,6 +437,16 @@ module Discourse
end
end
def self.last_commit_date
ensure_version_file_loaded
$last_commit_date ||=
begin
git_cmd = 'git log -1 --format="%ct"'
seconds = self.try_git(git_cmd, nil)
seconds.nil? ? nil : DateTime.strptime(seconds, '%s')
end
end
def self.try_git(git_cmd, default_value)
version_value = false