From e27cda13909eb15a58e682c1d1782ba85430313c Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Wed, 18 Feb 2015 18:06:11 +0200 Subject: [PATCH] refactor legal document attrs --- app/models/epp/contact.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb index 276b490d6..0a6c14020 100644 --- a/app/models/epp/contact.rb +++ b/app/models/epp/contact.rb @@ -5,9 +5,6 @@ class Epp::Contact < Contact # disable STI, there is type column present self.inheritance_column = :sti_disabled - # temp fix - has_many :legal_documents, as: :documentable - class << self # rubocop: disable Metrics/PerceivedComplexity # rubocop: disable Metrics/CyclomaticComplexity @@ -54,11 +51,10 @@ class Epp::Contact < Contact end def legal_document_attrs(legal_frame) - attrs = {}.with_indifferent_access - attrs[0] = {}.with_indifferent_access - attrs[0][:body] = legal_frame.text - attrs[0][:document_type] = legal_frame['type'] - attrs + [{ + body: legal_frame.text, + document_type: legal_frame['type'] + }] end end