Fix rubocop complains
This commit is contained in:
parent
d3b8284876
commit
b7fd7daee4
|
|
@ -43,26 +43,25 @@ class Projects::PagesController < Projects::ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@project.remove_pages
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to project_path(@project) }
|
||||
end
|
||||
end
|
||||
|
||||
def remove_pages
|
||||
project.remove_pages
|
||||
project.pages_domains.destroy_all
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
redirect_to(namespace_project_pages_path(@project.namespace, @project),
|
||||
notice: 'Pages were removed')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def pages_domain_params
|
||||
params.require(:pages_domain).permit(
|
||||
:certificate,
|
||||
:key,
|
||||
:domain
|
||||
:certificate,
|
||||
:key,
|
||||
:domain
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -62,12 +62,12 @@ class PagesDomain < ActiveRecord::Base
|
|||
def expired?
|
||||
return false unless x509
|
||||
current = Time.new
|
||||
return current < x509.not_before || x509.not_after < current
|
||||
current < x509.not_before || x509.not_after < current
|
||||
end
|
||||
|
||||
def subject
|
||||
return unless x509
|
||||
return x509.subject.to_s
|
||||
x509.subject.to_s
|
||||
end
|
||||
|
||||
def certificate_text
|
||||
|
|
|
|||
Loading…
Reference in New Issue