Commit 98531fc2 authored by Alexis Reigel's avatar Alexis Reigel
Browse files

upcase in the model instead of in the view

parent a59407408f5b
......@@ -37,6 +37,14 @@ class GpgKey < ActiveRecord::Base
after_commit :update_invalid_gpg_signatures, on: :create
after_commit :notify_user, on: :create
def primary_keyid
super&.upcase
end
def fingerprint
super&.upcase
end
def key=(value)
value.strip! unless value.blank?
write_attribute(:key, value)
......
......@@ -11,6 +11,10 @@ class GpgSignature < ActiveRecord::Base
validates :project, presence: true
validates :gpg_key_primary_keyid, presence: true
def gpg_key_primary_keyid
super&.upcase
end
def commit
project.commit(commit_sha)
end
......
......@@ -6,7 +6,7 @@
= render partial: 'email_with_badge', locals: { email: email, verified: verified }
.description
%code= key.fingerprint.upcase
%code= key.fingerprint
.pull-right
%span.key-created-at
created #{time_ago_with_tooltip(key.created_at)}
......
......@@ -9,7 +9,7 @@
= content
GPG Key ID:
%span.monospace= signature.gpg_key_primary_keyid.upcase
%span.monospace= signature.gpg_key_primary_keyid
= link_to('Learn more about signing commits', help_page_path('workflow/gpg_signed_commits/index.md'), class: 'gpg-popover-help-link')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment