Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: expose resource in resource tools intializers #2432

Merged
merged 1 commit into from Jan 31, 2024

Conversation

adrianthedev
Copy link
Collaborator

Description

Fixes avo-hq/docs.avohq.io#163

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Manual review steps

Try to use the resource, parent, and view in a resource tool initializer.

class Avo::ResourceTools::FishInformation < Avo::BaseResourceTool
  def initialize(**kwargs)
    super(**kwargs)

    abort [parent.class, resource.class, view].inspect # 馃憟 these objects are available in the initializer
  end
end

Manual reviewer: please leave a comment with output from the test if that's the case.

Copy link

codeclimate bot commented Jan 31, 2024

Code Climate has analyzed commit c09029d and detected 0 issues on this pull request.

View more on Code Climate.

@adrianthedev adrianthedev merged commit d274a39 into main Jan 31, 2024
22 of 23 checks passed
@adrianthedev adrianthedev deleted the feature/expose-resource-in-tool-initializer branch January 31, 2024 10:03
Copy link
Contributor

This PR has been merged into main. The functionality will be available in the next release.

Please check the release guide for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DUP] Show an example on how to declare variables on resource tools
1 participant