Fixed: Show only active memberships in testers block
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
d7305c1a2e
commit
45968d7349
|
@ -100,6 +100,6 @@ class Membership extends Model
|
||||||
*/
|
*/
|
||||||
public function scopeTrying(Builder $query): Builder
|
public function scopeTrying(Builder $query): Builder
|
||||||
{
|
{
|
||||||
return $query->whereHas('activity', fn ($builder) => $builder->where('is_try', true));
|
return $query->active()->whereHas('activity', fn ($builder) => $builder->where('is_try', true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,10 @@ class TestersBlockTest extends TestCase
|
||||||
->defaults()
|
->defaults()
|
||||||
->has(Membership::factory()->in('Schnuppermitgliedschaft', 7, 'Wölfling', 8)->state(['created_at' => now()->subMonths(10)]))
|
->has(Membership::factory()->in('Schnuppermitgliedschaft', 7, 'Wölfling', 8)->state(['created_at' => now()->subMonths(10)]))
|
||||||
->create(['firstname' => 'Max', 'lastname' => 'Muster']);
|
->create(['firstname' => 'Max', 'lastname' => 'Muster']);
|
||||||
|
$inactiveMember = Member::factory()
|
||||||
|
->defaults()
|
||||||
|
->has(Membership::factory()->ended()->in('Schnuppermitgliedschaft', 7, 'Wölfling', 8)->state(['created_at' => now()->subMonths(10)]))
|
||||||
|
->create(['firstname' => 'Max', 'lastname' => 'Muster']);
|
||||||
|
|
||||||
$data = app(TestersBlock::class)->render()['data'];
|
$data = app(TestersBlock::class)->render()['data'];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue