Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
horcsinbalint committed Apr 12, 2024
1 parent 9d6a3e0 commit e864c90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/Models/GeneralAssemblies/GeneralAssembly.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function missingUsers(): array
if($this->isOpen()) {
$users_that_should_attend = $this->usersThatShouldAttendByDefaultAnOpenAssembly();
} else {
$users_that_should_attend = $this->usersThatShouldAttendedByDefault()->get();
$users_that_should_attend = $this->usersThatShouldHaveAttendedByDefault()->get();
}
foreach($users_that_should_attend as $user) {
if (!$this->isAttended($user) && !$this->excusedUsers()->where('user_id', $user->id)->exists()) {
Expand All @@ -180,7 +180,7 @@ public function missingUsers(): array
/**
* @return BelongsToMany The users who should have attended the general assembly.
*/
public function usersThatShouldAttendedByDefault(): BelongsToMany
public function usersThatShouldHaveAttendedByDefault(): BelongsToMany
{
return $this->belongsToMany(User::class, 'user_should_attend_general_assembly');
}
Expand Down
2 changes: 1 addition & 1 deletion app/Observers/GeneralAssemblyObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function closed(GeneralAssembly $generalAssembly): void
{
foreach(User::all() as $user) {
if ($generalAssembly->shouldAttendByDefault($user)) {
$generalAssembly->usersThatShouldAttendedByDefault()->attach($user);
$generalAssembly->usersThatShouldHaveAttendedByDefault()->attach($user);
}
}
}
Expand Down

0 comments on commit e864c90

Please sign in to comment.