From 028ca94d498e31fb5a442c30bc216d69e2ff7fe9 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Thu, 25 Sep 2014 17:05:16 +0300 Subject: [PATCH] Remove redundant concern --- .../concerns/shared/common_domain.rb | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 app/controllers/concerns/shared/common_domain.rb diff --git a/app/controllers/concerns/shared/common_domain.rb b/app/controllers/concerns/shared/common_domain.rb deleted file mode 100644 index 4a54c68c0..000000000 --- a/app/controllers/concerns/shared/common_domain.rb +++ /dev/null @@ -1,31 +0,0 @@ -module Shared::CommonDomain - extend ActiveSupport::Concern - - included do - load_and_authorize_resource - before_action :set_domain, only: [:show, :edit, :update, :destroy] - before_action :verify_deletion, only: [:destroy] - end - - def edit - build_associations - end - - private - - def set_domain - @domain = Domain.find(params[:id]) - end - - def build_associations - @domain.nameservers.build if @domain.nameservers.empty? - @domain.domain_contacts.build if @domain.domain_contacts.empty? - @domain.domain_statuses.build if @domain.domain_statuses.empty? - end - - def verify_deletion - return if @domain.can_be_deleted? - flash[:alert] = I18n.t('shared.domain_status_prohibits_deleting') - redirect_to [:admin, @domain] - end -end