Page MenuHomeDevCentral

UserExternalSource: cast user_id property as integer
ClosedPublic

Authored by dereckson on Jul 2 2016, 08:59.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 10, 19:29
Unknown Object (File)
Sun, Nov 10, 01:17
Unknown Object (File)
Thu, Nov 7, 23:17
Unknown Object (File)
Wed, Oct 23, 15:17
Unknown Object (File)
Wed, Oct 23, 15:08
Unknown Object (File)
Oct 14 2024, 23:36
Unknown Object (File)
Oct 9 2024, 18:19
Unknown Object (File)
Oct 8 2024, 14: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.