From a1ff4064b3a90fd46138d6b7a777770d1254b04b Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Wed, 23 Sep 2015 12:49:11 +0300 Subject: [PATCH] rubocop updates --- app/models/depp/contact.rb | 8 +++++++- app/models/epp/contact.rb | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/models/depp/contact.rb b/app/models/depp/contact.rb index d85292bad..0fa9f777a 100644 --- a/app/models/depp/contact.rb +++ b/app/models/depp/contact.rb @@ -230,6 +230,9 @@ module Depp handle_errors(data) end + # rubocop:disable Metrics/CyclomaticComplexity + # rubocop:disable Style/NegatedIf + # rubocop:disable Style/RedundantSelf def extension_xml(action) xml = { _anonymus: [] } @@ -237,7 +240,7 @@ module Depp when :create ident = ident_xml[:_anonymus].try(:first) when :update - # detect if any ident has changed + # detect if any ident has changed, nb! ident and self.ident is not always same if !(ident == self.ident && ident == self.ident_type && ident_country_code == self.ident_country_code) ident = ident_xml[:_anonymus].try(:first) end @@ -248,6 +251,9 @@ module Depp xml[:_anonymus] << legal if legal.present? xml end + # rubocop:enable Metrics/CyclomaticComplexity + # rubocop:enable Style/NegatedIf + # rubocop:enable Style/RedundantSelf def ident_xml { diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb index 8054d590b..57bf9192a 100644 --- a/app/models/epp/contact.rb +++ b/app/models/epp/contact.rb @@ -133,6 +133,7 @@ class Epp::Contact < Contact } end + # rubocop:disable Metrics/AbcSize def update_attributes(frame) return super if frame.blank? at = {}.with_indifferent_access @@ -161,6 +162,7 @@ class Epp::Contact < Contact super(at) end + # rubocop:enable Metrics/AbcSize def statuses_attrs(frame, action) status_list = status_list_from(frame)