Fix some data integrity issues

This commit is contained in:
Dane Everitt 2018-02-17 13:37:53 -06:00
parent d52f8d9215
commit 241f7d0125
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
6 changed files with 41 additions and 37 deletions

View file

@ -44,10 +44,15 @@ class VariableCreationService
$options = array_get($data, 'options') ?? [];
return $this->repository->create(array_merge($data, [
return $this->repository->create([
'egg_id' => $egg,
'name' => $data['name'] ?? '',
'description' => $data['description'] ?? '',
'env_variable' => $data['env_variable'] ?? '',
'default_value' => $data['default_value'] ?? '',
'user_viewable' => in_array('user_viewable', $options),
'user_editable' => in_array('user_editable', $options),
]));
'rules' => $data['rules'] ?? '',
]);
}
}