mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 13:36:15 +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
|
def assign_metadata
|
||||||
return if errors.any?
|
return if errors.any?
|
||||||
|
|
||||||
origin = crt ? parsed_crt : parsed_csr
|
parse_metadata(certificate_origin)
|
||||||
parse_metadata(origin)
|
|
||||||
rescue NoMethodError
|
rescue NoMethodError
|
||||||
errors.add(:base, I18n.t(:invalid_csr_or_crt))
|
errors.add(:base, I18n.t(:invalid_csr_or_crt))
|
||||||
end
|
end
|
||||||
|
@ -135,6 +134,10 @@ class Certificate < ApplicationRecord
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def certificate_origin
|
||||||
|
crt ? parsed_crt : parsed_csr
|
||||||
|
end
|
||||||
|
|
||||||
def create_tempfile(filename, content = '')
|
def create_tempfile(filename, content = '')
|
||||||
tempfile = Tempfile.new(filename)
|
tempfile = Tempfile.new(filename)
|
||||||
tempfile.write(content)
|
tempfile.write(content)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue