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

[ADVAPP-1185]: Include additional details like date created and created by to the display of files attached to a student or prospect record #1289

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

amit-canyon
Copy link
Contributor

Ticket(s) or GitHub Issue

Technical Description

Include additional details like date created and created by to the display of files attached to a student or prospect record

Any deployment steps required?

No

Are any Feature Flags and/or Data Migrations that can eventually be removed Added?

Yes, EngagementFilesCreatedByFeature


Before contributing and submitting this PR, make sure you have Read, agree, and are compliant with the contributing guidelines.

…splay of files attached to a student or prospect record
@amit-canyon amit-canyon requested a review from a team as a code owner February 7, 2025 06:37
Copy link

sonarqubecloud bot commented Feb 7, 2025


class EngagementFileObserver
{
public function saving(EngagementFile $engagementFile): void
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's change this to creating instead of saving. We only want this to happen when the file is created, not updated.

{
$user = auth()->user();

if (EngagementFilesCreatedByFeature::active() && $user instanceof User && is_null($engagementFile->created_by_id)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's remove the $user instanceof User check here. The point of making the relationship polymorphic was to allow for it to be other records that can create. So no need to check the type here.

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.

2 participants