diff --git a/app/controllers/admin/bsa_protected_domains_controller.rb b/app/controllers/admin/bsa_protected_domains_controller.rb index e244878607..aaf4ed24ab 100644 --- a/app/controllers/admin/bsa_protected_domains_controller.rb +++ b/app/controllers/admin/bsa_protected_domains_controller.rb @@ -67,8 +67,6 @@ def release_to_auction private def bsa_protected_domain_params - # params.require(:bsa_protected_domain).permit(:domain_name, :registration_code, :order_id, :suborder_id, :create_date, :state) - params.require(:bsa_protected_domain).permit(:domain_name, :registration_code, :order_id, :suborder_id, :create_date, :state).tap do |whitelisted| whitelisted[:state] = whitelisted[:state].to_i if whitelisted[:state].is_a?(String) diff --git a/app/jobs/fetch_godaddy_bsa_block_order_list_job.rb b/app/jobs/fetch_godaddy_bsa_block_order_list_job.rb index a9e6d93fff..3d6f50f38f 100644 --- a/app/jobs/fetch_godaddy_bsa_block_order_list_job.rb +++ b/app/jobs/fetch_godaddy_bsa_block_order_list_job.rb @@ -13,6 +13,8 @@ def perform(status_name = QUEUED_FOR_ACTIVATION) fetch_block_order_list(offset: 0, status_name: status_name) end + # rubocop:disable Metrics/CognitiveComplexity + # rubocop:disable Rails::SkipsModelValidations def fetch_block_order_list(offset:, status_name:) res = Bsa::BlockOrderListService.call(offset: offset, limit: LIMIT, q: { 'blockOrderStatus.name' => status_name }) @@ -28,6 +30,8 @@ def fetch_block_order_list(offset:, status_name:) offset += 1 fetch_block_order_list(offset: offset, status_name: status_name) end + # rubocop:enable Metrics/CognitiveComplexity + # rubocop:enable Rails::SkipsModelValidations def collect_bsa_values(res) res.body.list.map do |block_order| @@ -39,8 +43,10 @@ def collect_bsa_values(res) registration_code: SecureRandom.hex, create_date: DateTime.parse(block_order['createdDt']), created_at: Time.zone.now, - updated_at: Time.zone.now + updated_at: Time.zone.now, } end end end + +# rubocop:enable diff --git a/app/jobs/update_godaddy_domains_status_job.rb b/app/jobs/update_godaddy_domains_status_job.rb index 1177ea901a..dcce19571d 100644 --- a/app/jobs/update_godaddy_domains_status_job.rb +++ b/app/jobs/update_godaddy_domains_status_job.rb @@ -28,7 +28,9 @@ def serialize_suborders_block(suborders_block:, state:) end end + # rubocop:disable Rails::SkipsModelValidations def refresh_statuses(suborders_block:, state:) suborders_block.update_all(state: state) end + # rubocop:enable Rails::SkipsModelValidations end diff --git a/app/models/bsa_protected_domain.rb b/app/models/bsa_protected_domain.rb index d33d778468..25e3a558f1 100644 --- a/app/models/bsa_protected_domain.rb +++ b/app/models/bsa_protected_domain.rb @@ -18,7 +18,7 @@ class BsaProtectedDomain < ApplicationRecord ACTIVE => 4, QUEUED_FOR_RELEASE => 5, RELEASE_IN_PROGRESS => 6, - CLOSED => 7 + CLOSED => 7, } class << self diff --git a/app/models/bsa_protected_domain/ransackable.rb b/app/models/bsa_protected_domain/ransackable.rb index cd5009025a..323793f7dd 100644 --- a/app/models/bsa_protected_domain/ransackable.rb +++ b/app/models/bsa_protected_domain/ransackable.rb @@ -10,5 +10,4 @@ def ransackable_attributes(*) authorizable_ransackable_attributes end end - end diff --git a/app/services/bsa/application_service.rb b/app/services/bsa/application_service.rb index c315ccc159..1bd1f89e92 100644 --- a/app/services/bsa/application_service.rb +++ b/app/services/bsa/application_service.rb @@ -18,13 +18,13 @@ def connect(url:) def headers(content_type: 'x-www-form-urlencoded') { - 'Content-Type' => "application/#{content_type}" + 'Content-Type' => "application/#{content_type}", } end def token_format(token) { - 'Authorization' => "Bearer #{token}" + 'Authorization' => "Bearer #{token}", } end @@ -54,8 +54,10 @@ def expire_token_at(token) Time.at(payload['exp']).utc.in_time_zone end + # rubocop:disable Style/GlobalVars def redis @redis ||= Rails.env.test? ? $mock_redis : Redis.new(host: redist_host, port: redis_port, db: redis_db) end + # rubocop:enable Style/GlobalVars end end diff --git a/app/services/bsa/auth_service.rb b/app/services/bsa/auth_service.rb index 73cbf420e0..c84bb032c7 100644 --- a/app/services/bsa/auth_service.rb +++ b/app/services/bsa/auth_service.rb @@ -51,7 +51,7 @@ def check_for_expired_token def payload { 'apiKey' => api_key, - 'space' => bsa + 'space' => bsa, } end diff --git a/app/services/bsa/block_order_list_service.rb b/app/services/bsa/block_order_list_service.rb index d1055d0788..28538da796 100644 --- a/app/services/bsa/block_order_list_service.rb +++ b/app/services/bsa/block_order_list_service.rb @@ -5,6 +5,7 @@ class BlockOrderListService attr_reader :sort_by, :order, :offset, :limit, :q + # rubocop:disable Naming/UncommunicativeMethodParamName def self.call(sort_by: nil, order: nil, offset: nil, limit: nil, q: {}) new(sort_by: sort_by, order: order, offset: offset, limit: limit, q: q).call end @@ -16,6 +17,7 @@ def initialize(sort_by:, order:, offset:, limit:, q:) @limit = limit @q = q end + # rubocop:enable Naming/UncommunicativeMethodParamName def call http = connect(url: base_url)