Page MenuHomeDevCentral

UserExternalSource: cast user_id property as integer
ClosedPublic

Authored by dereckson on Jul 2 2016, 08:59.
Tags
None
Referenced Files
F7584884: D447.id1081.diff
Tue, Apr 29, 05:47
F7584870: D447.id.diff
Tue, Apr 29, 05:47
Unknown Object (File)
Mon, Apr 28, 16:21
Unknown Object (File)
Mon, Apr 28, 10:03
Unknown Object (File)
Sun, Apr 27, 06:22
Unknown Object (File)
Sat, Apr 26, 08:40
Unknown Object (File)
Sun, Apr 20, 05:05
Unknown Object (File)
Sat, Apr 19, 15:42
Subscribers
None

Details

Summary

Code using the UserExternalSource model expects user ID to be
an integer, and not a string:

$externalUser = UserExternalSource::find(1);
// Does something with $externalUser->user_id

Eloquent allows to specify attributes casting with a $casts array.

Test Plan

Tested through D445 new unit test which provide:
$this->assertSame($externalUser->user_id, 1);

Diff Detail

Repository
rGROVE Auth Grove
Lint
Lint Passed
Unit
No Test Coverage
Branch
model
Build Status
Buildable 622
Build 741: arc lint + arc unit

Event Timeline

dereckson retitled this revision from to UserExternalSource: cast user_id property as integer.
dereckson updated this object.
dereckson edited the test plan for this revision. (Show Details)
dereckson added a reviewer: dereckson.
dereckson edited edge metadata.
This revision is now accepted and ready to land.Jul 2 2016, 08:59
This revision was automatically updated to reflect the committed changes.