Skip to content

Conversation

@fulcanelly fulcanelly requested a review from a team as a code owner August 3, 2023 16:46
Copy link
Contributor

@ecoologic ecoologic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @fulcanelly. Thank you for your contribution.

A couple of comments, but mainly, we can't approve any work that doesn't come with tests.

Could you write some unit tests for this?

Thanks again


class TargetFailure < ReadResource
def target
@client.targets.to_a.find do |target|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use .all in stead of to_a you should be able to reduce the number of calls in case of pagination.

class TargetFailure < ReadResource
def target
@client.targets.to_a.find do |target|
target.title == self.target_name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the match is done on title, I would suggest naming the method target_by_title. (?? not too sure).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants