mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 05:26:17 +02:00
Fixed codeclimate issue
This commit is contained in:
parent
47b6a1b87a
commit
a9ed98d994
1 changed files with 5 additions and 2 deletions
|
@ -39,8 +39,7 @@ class Certificate < ApplicationRecord
|
|||
def assign_metadata
|
||||
return if errors.any?
|
||||
|
||||
origin = crt ? parsed_crt : parsed_csr
|
||||
parse_metadata(origin)
|
||||
parse_metadata(certificate_origin)
|
||||
rescue NoMethodError
|
||||
errors.add(:base, I18n.t(:invalid_csr_or_crt))
|
||||
end
|
||||
|
@ -135,6 +134,10 @@ class Certificate < ApplicationRecord
|
|||
|
||||
private
|
||||
|
||||
def certificate_origin
|
||||
crt ? parsed_crt : parsed_csr
|
||||
end
|
||||
|
||||
def create_tempfile(filename, content = '')
|
||||
tempfile = Tempfile.new(filename)
|
||||
tempfile.write(content)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue