Skip to content

Commit

Permalink
Fix rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
lpichler committed Aug 23, 2018
1 parent 399d211 commit bef790d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/models/mixins/assignment_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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

Expand Down

0 comments on commit bef790d

Please sign in to comment.