diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 852c41c1f..ba0518c2c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -202,5 +202,7 @@ def current_commit end [shasum, date] + rescue + [nil, nil] end end diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index 57b5b54f0..909be8b49 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -16,9 +16,9 @@ <% sha, date = current_commit %> -
Powered by <%= link_to 'Codidact', 'https://codidact.org/' %>. Version <%= +
Powered by <%= link_to 'Codidact', 'https://codidact.org/' %>. <% if sha&.present? %>Version <%= link_to sha[0..7], "https://github.com/codidact/qpixel/commit/#{sha}" - %> (<%= date.to_time.utc.strftime('%F %TZ') %>) + %> (<%= date.to_time.utc.strftime('%F %TZ') %>)<% end %>