From 7f0787b27f6f9abb1d8c843d7337881ccda3fd71 Mon Sep 17 00:00:00 2001 From: Sergei Tsoganov Date: Thu, 6 Apr 2023 21:53:25 +0300 Subject: [PATCH] Fixed codeclimate issues --- app/controllers/admin/domains_controller.rb | 20 ++++++++++---------- app/models/domain.rb | 6 ------ 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/app/controllers/admin/domains_controller.rb b/app/controllers/admin/domains_controller.rb index 89fcd473c..58a482dc6 100644 --- a/app/controllers/admin/domains_controller.rb +++ b/app/controllers/admin/domains_controller.rb @@ -5,6 +5,7 @@ module Admin before_action :set_domain, only: %i[show edit update download keep] authorize_resource + # rubocop:disable Metrics/MethodLength def index params[:q] ||= {} domains = Domain.includes(:registrar, :registrant).joins(:registrar, :registrant) @@ -22,16 +23,6 @@ module Admin render_by_format('admin/domains/index', 'domains') end - def show - # Validation is needed to warn users - @domain.validate - end - - def edit - build_associations - end - - # rubocop:disable Metrics/MethodLength def update rollback_history = @domain.json_statuses_history&.[]('admin_store_statuses_history') dp = ignore_empty_statuses @@ -51,6 +42,15 @@ module Admin end # rubocop:enable Metrics/MethodLength + def show + # Validation is needed to warn users + @domain.validate + end + + def edit + build_associations + end + def versions @domain = Domain.where(id: params[:domain_id]).includes({ versions: :item }).first @versions = @domain.versions diff --git a/app/models/domain.rb b/app/models/domain.rb index 6685d6127..655902e81 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -665,12 +665,6 @@ class Domain < ApplicationRecord self.outzone_at = Time.current end - def manage_automatic_statuses - check_nameservers - check_statuses - check_pending_delete - end - def manage_automatic_statuses unless self.class.nameserver_required? deactivate if nameservers.reject(&:marked_for_destruction?).empty?