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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resource instance variables and audit log sample #2478

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

goosys
Copy link
Contributor

@goosys goosys commented Dec 26, 2023

I have made changes so that instance variables are stored in both the index and create actions, in order to capture controller operation logs and perform other post-processing tasks.
Please review.

@goosys goosys force-pushed the resource-instance-variables branch from 5cb4851 to e77fb39 Compare December 26, 2023 06:49
@goosys goosys force-pushed the resource-instance-variables branch from e77fb39 to 7d6f2c4 Compare December 26, 2023 06:55
@@ -9,6 +9,7 @@ def index
resources = apply_collection_includes(resources)
resources = order.apply(resources)
resources = paginate_resources(resources)
@resources = resources
Copy link
Member

Choose a reason for hiding this comment

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

This should be available through the locals (see lines 14-19). What use case do you have where that's not enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For consistency. Since I made @requested_resource and @new_resource as instance variables, I made it so that @resources can also be referenced from instance variables.

@pablobm
Copy link
Collaborator

pablobm commented Oct 29, 2024

I'm ok with this, but I think it should be consistent and always be @resource (and @resources for the plural case).

Thoughts, @nickcharlton?

@nickcharlton
Copy link
Member

Ah yeah, I see. Yeah, consistency is important here.

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

Successfully merging this pull request may close these issues.

3 participants