internetee-registry/db/data/20150601083516_add_cert_common_name.rb
2020-02-26 13:26:48 +05:00

15 lines
370 B
Ruby

class AddCertCommonName < ActiveRecord::Migration[5.1]
def self.up
# Certificate.all.each do |x|
# if x.crt.blank? && x.csr.present?
# pc = x.parsed_csr.try(:subject).try(:to_s) || ''
# cn = pc.scan(/\/CN=(.+)/).flatten.first
# x.common_name = cn.split('/').first
# end
# x.save
# end
end
def self.down
end
end