rubocop updates

This commit is contained in:
Priit Tark 2015-09-23 12:49:11 +03:00
parent 4a32c7641c
commit a1ff4064b3
2 changed files with 9 additions and 1 deletions

View file

@ -230,6 +230,9 @@ module Depp
handle_errors(data) handle_errors(data)
end end
# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Style/NegatedIf
# rubocop:disable Style/RedundantSelf
def extension_xml(action) def extension_xml(action)
xml = { _anonymus: [] } xml = { _anonymus: [] }
@ -237,7 +240,7 @@ module Depp
when :create when :create
ident = ident_xml[:_anonymus].try(:first) ident = ident_xml[:_anonymus].try(:first)
when :update 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) if !(ident == self.ident && ident == self.ident_type && ident_country_code == self.ident_country_code)
ident = ident_xml[:_anonymus].try(:first) ident = ident_xml[:_anonymus].try(:first)
end end
@ -248,6 +251,9 @@ module Depp
xml[:_anonymus] << legal if legal.present? xml[:_anonymus] << legal if legal.present?
xml xml
end end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Style/NegatedIf
# rubocop:enable Style/RedundantSelf
def ident_xml def ident_xml
{ {

View file

@ -133,6 +133,7 @@ class Epp::Contact < Contact
} }
end end
# rubocop:disable Metrics/AbcSize
def update_attributes(frame) def update_attributes(frame)
return super if frame.blank? return super if frame.blank?
at = {}.with_indifferent_access at = {}.with_indifferent_access
@ -161,6 +162,7 @@ class Epp::Contact < Contact
super(at) super(at)
end end
# rubocop:enable Metrics/AbcSize
def statuses_attrs(frame, action) def statuses_attrs(frame, action)
status_list = status_list_from(frame) status_list = status_list_from(frame)