From bef790da6822d1d55bca904b35ff53212734767b Mon Sep 17 00:00:00 2001 From: lpichler Date: Thu, 23 Aug 2018 12:39:02 +0200 Subject: [PATCH] Fix rubocop --- app/models/mixins/assignment_mixin.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/models/mixins/assignment_mixin.rb b/app/models/mixins/assignment_mixin.rb index 002dd915b7b8..683b0c84ef66 100644 --- a/app/models/mixins/assignment_mixin.rb +++ b/app/models/mixins/assignment_mixin.rb @@ -194,9 +194,7 @@ def get_assigned_for_target(target, options = {}) parents << target end - parents.each do |parent| - _log.debug("parent id: #{parent.id} class: #{parent.class}") - end if parents.kind_of?(Array) + parents.each { |parent| _log.debug("parent id: #{parent.id} class: #{parent.class}") } if parents.kind_of?(Array) tlist = parents.collect { |p| "#{p.class.base_model.name.underscore}/id/#{p.id}" } # Assigned directly to parents if options[:tag_list] # Assigned to target (passed in) @@ -208,7 +206,7 @@ def get_assigned_for_target(target, options = {}) individually_assigned_resources = tlist.flat_map { |t| assignments_cached[t] }.uniq - _log.debug("Individually assigned resources: #{individually_assigned_resources.map {|x| "id:#{x.id} class:#{x.class}" }.join(', ')}") + _log.debug("Individually assigned resources: #{individually_assigned_resources.map { |x| "id:#{x.id} class:#{x.class}" }.join(', ')}") # look for alert_set running off of tags (not individual tags) # TODO: we may need to change taggings-related code to use base_model too @@ -221,7 +219,7 @@ def get_assigned_for_target(target, options = {}) _log.debug("Tags assigned to parents: #{tlist.join(', ')}") tagged_resources = tlist.flat_map { |t| assignments_cached[t] }.uniq - _log.debug("Tagged resources: #{individually_assigned_resources.map {|x| "id:#{x.id} class:#{x.class}" }.join(', ')}") + _log.debug("Tagged resources: #{individually_assigned_resources.map { |x| "id:#{x.id} class:#{x.class}" }.join(', ')}") (individually_assigned_resources + tagged_resources).uniq end