From b05888a6353e1c1b960cea5954c9fd106ef94d92 Mon Sep 17 00:00:00 2001 From: Keenan Brock Date: Thu, 23 Aug 2018 14:02:47 -0400 Subject: [PATCH] relationships: methods called twice over refactoring/rebasing, looks like a few methods are getting called multiple times --- app/models/mixins/relationship_mixin.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/mixins/relationship_mixin.rb b/app/models/mixins/relationship_mixin.rb index 8f4ddce0f8c..9ee7dd91b98 100644 --- a/app/models/mixins/relationship_mixin.rb +++ b/app/models/mixins/relationship_mixin.rb @@ -127,7 +127,7 @@ def parent_rel_ids def parent_rels(*args) options = args.extract_options! pri = parent_rel_ids - rels = pri.kind_of?(Array) && pri.empty? ? Relationship.none : Relationship.where(:id => parent_rel_ids) + rels = pri.kind_of?(Array) && pri.empty? ? Relationship.none : Relationship.where(:id => pri) Relationship.filter_by_resource_type(rels, options) end @@ -504,7 +504,6 @@ def fulltree_rels_arranged(*args) options = args.extract_options! root_id = relationship.try(:root_id) return {relationship_for_isolated_root => {}} if root_id.nil? - Relationship.subtree_of(root_id).arrange Relationship.filter_by_resource_type(Relationship.subtree_of(root_id), options).arrange end