Method: ApplicationHelper#current_commit

Defined in:
app/helpers/application_helper.rb

#current_commitArray(String, DateTime)

Get the current active commit information to display in the footer.

Returns:

  • (Array(String, DateTime))

    Two values: the commit hash and the timestamp.



319
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'app/helpers/application_helper.rb', line 319

def current_commit
  commit_info = Rails.cache.persistent('current_commit')
  shasum, timestamp = commit_info

  begin
    date = DateTime.iso8601(timestamp)
  rescue
    date = DateTime.parse(timestamp)
  end

  [shasum, date]
rescue
  [nil, nil]
end