Fixed: Joined_at can be null
This commit is contained in:
parent
2f21031d49
commit
39bf3fc7f8
|
@ -78,14 +78,12 @@ class Member extends Model {
|
||||||
$this->attributes['gender_id'] = data_get($this->geschlechtMaps, $v, null);
|
$this->attributes['gender_id'] = data_get($this->geschlechtMaps, $v, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAttributeValue($key) {
|
public function setAttribute($key, $value) {
|
||||||
$original = parent::getAttributeValue($key);
|
if (in_array($key, $this->nullable) && $value === '') {
|
||||||
|
return parent::setAttribute($key, null);
|
||||||
if (in_array($key, $this->nullable) && $original === '') {
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $original;
|
return parent::setAttribute($key, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,8 +79,8 @@ class PullMemberTest extends TestCase
|
||||||
|
|
||||||
$group = Nami::group(103);
|
$group = Nami::group(103);
|
||||||
|
|
||||||
$this->assertSame($values[0], $group->member(16)->{$key});
|
$this->assertSame($values[0], $group->member(16)->toArray()[$key]);
|
||||||
$this->assertSame($values[1], $group->member(17)->{$key});
|
$this->assertSame($values[1], $group->member(17)->toArray()[$key]);
|
||||||
|
|
||||||
Http::assertSentCount(5);
|
Http::assertSentCount(5);
|
||||||
}
|
}
|
||||||
|
@ -100,10 +100,9 @@ class PullMemberTest extends TestCase
|
||||||
|
|
||||||
Nami::login();
|
Nami::login();
|
||||||
|
|
||||||
$this->assertSame([
|
$member = Nami::group(103)->members();
|
||||||
16 => $values[0],
|
$this->assertSame($values[0], $member->get(0)->toArray()[$key]);
|
||||||
17 => $values[1]
|
$this->assertSame($values[1], $member->get(1)->toArray()[$key]);
|
||||||
], Nami::group(103)->members()->pluck($key, 'id')->toArray());
|
|
||||||
|
|
||||||
Http::assertSentCount(6);
|
Http::assertSentCount(6);
|
||||||
}
|
}
|
||||||
|
@ -147,7 +146,7 @@ class PullMemberTest extends TestCase
|
||||||
|
|
||||||
$group = Nami::group(103);
|
$group = Nami::group(103);
|
||||||
|
|
||||||
$this->assertSame($values[0], $group->member(16)->{$key});
|
$this->assertSame($values[0], $group->member(16)->toArray()[$key]);
|
||||||
|
|
||||||
Http::assertSentCount(5);
|
Http::assertSentCount(5);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue