diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 608ddded7..8de3fdc70 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -34,12 +34,15 @@ module ApplicationHelper end def current_commit_link - hash = CURRENT_COMMIT_HASH - current_repo = CURRENT_COMMIT_REPO.gsub('com:', 'com/') - .gsub('git@', 'https://') - .gsub('.git', '') + hash = `git rev-parse --short HEAD` + current_repo = `git remote get-url origin`.gsub('com:', 'com/') + .gsub('git@', 'https://') + .gsub('.git', '') - link_to hash.to_s, "#{current_repo}/commit/#{hash}", class: 'footer-version-link' + link_to hash.to_s, "#{current_repo}/commit/#{hash}", + class: 'footer-version-link', + target: '_blank', + rel: 'noopener' end def creator_link(model) diff --git a/config/initializers/current_commit_hash.rb b/config/initializers/current_commit_hash.rb deleted file mode 100644 index edba19a42..000000000 --- a/config/initializers/current_commit_hash.rb +++ /dev/null @@ -1,2 +0,0 @@ -CURRENT_COMMIT_HASH = `git rev-parse --short HEAD` -CURRENT_COMMIT_REPO = `git remote get-url origin`