set default storage unit #189

This commit is contained in:
Nabeel Shahzad 2018-02-10 22:18:07 -06:00
parent f14a9e3ba1
commit 9b9a20b437

View File

@ -111,7 +111,7 @@ class Pirep extends BaseModel
{
try {
$distance = (float) $this->attributes['distance'];
return new Distance($distance, 'mi');
return new Distance($distance, Distance::STORAGE_UNIT);
} catch (NonNumericValue $e) {
return 0;
} catch (NonStringUnitName $e) {
@ -140,7 +140,7 @@ class Pirep extends BaseModel
{
try {
$distance = (float) $this->attributes['planned_distance'];
return new Distance($distance, 'mi');
return new Distance($distance, Distance::STORAGE_UNIT);
} catch (NonNumericValue $e) {
return 0;
} catch (NonStringUnitName $e) {