Skip to content

Commit 6da9b7b

Browse files
author
Admin
committed
Improve Active Record Segregation Properties
1 parent 780b53e commit 6da9b7b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Models/BaseModel.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,13 +455,11 @@ protected function initializeActiveRecordSegregationProperties(): void
455455

456456
foreach ([self::A => 'Attributes', self::R => 'Relations'] as $property => $postfix) {
457457
try {
458-
$this->$property = new ($classFqn = $prefix . $this->$postfix)($this);
458+
$this->$property = new ($classFqn = $prefix . $postfix)($this);
459459
} catch (\Throwable) {
460460
$this->$property =
461461
new ($classFqn = 'MacropaySolutions\LaravelCrudWizard\Models\Attributes\BaseModel' .
462-
$this->$postfix)(
463-
$this
464-
);
462+
$postfix)($this);
465463
}
466464

467465
self::$activeRecordFqnSegregationPropertiesFqnsMap[$class][$property] = $classFqn;

0 commit comments

Comments
 (0)