Skip to content

WIP - Refactor custom fields handling for storage #15044

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

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

Conversation

snipe
Copy link
Member

@snipe snipe commented Jul 8, 2024

This just condenses down the custom field stuff into a smaller method. @uberbrady - I know you were working on something similar for the upcoming custom fields for users, but this should be a nicer way for us to bridge that gap. I just need to make sure the additional tests are there. We do something slightly different with bulk updating assets, since we're passing it an updated array there, so I didn't touch that for now.

Copy link

what-the-diff bot commented Jul 8, 2024

PR Summary

  • Implementation of New Method for Custom Fields
    We have introduced the handleCustomFieldsForStoring method in the Asset model. This new method is designated to manage updates to the custom fields.

  • Consolidating Code in AssetsController
    We have streamlined the code in both Api/AssetsController.php and AssetsController.php files. The sections dealing with the update of custom fields in store and update methods have been replaced with a call to the new handleCustomFieldsForStoring method. This results in cleaner and more efficient code.

  • Inclusion of Additional Facades in Asset model
    We have included usage of Illuminate\Support\Facades\Crypt and Illuminate\Support\Facades\Gate in the Asset model. They provide important functionalities necessary for encryption processes and authorization checks.

@snipe
Copy link
Member Author

snipe commented Jul 8, 2024

Tests failing here (only on Sqlite) - looking into it

@snipe snipe requested a review from uberbrady July 11, 2024 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant