Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement field option to set as nullable for create input type #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

erikgaal
Copy link
Contributor

Fixes #78

@codecov
Copy link

codecov bot commented Dec 17, 2018

Codecov Report

Merging #86 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #86      +/-   ##
============================================
+ Coverage     84.39%   84.43%   +0.04%     
- Complexity      647      649       +2     
============================================
  Files            75       75              
  Lines          1878     1883       +5     
============================================
+ Hits           1585     1590       +5     
  Misses          293      293
Impacted Files Coverage Δ Complexity Δ
src/Fields/Field.php 90.78% <100%> (+0.33%) 66 <2> (+2) ⬆️
src/Types/CreateInputType.php 100% <100%> (ø) 4 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c71e53...b3d26f4. Read the comment docs.

@@ -49,8 +49,8 @@ protected function getFillableFields(): Collection
$fields = parent::getFillableFields();
$defaults = $this->model->getAttributes();

return $fields->map(function (Field $field, $key) use ($defaults) {
if (in_array($key, array_keys($defaults))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should still be there. nullableOnCreate should just be an addition for more complex use cases where the default will be set by an observer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay. 👍

@robertvansteen robertvansteen changed the title Implement field option to set as nullable for create input type [3.0] Implement field option to set as nullable for create input type Feb 28, 2019
@robertvansteen robertvansteen added this to the 3.0 milestone Feb 28, 2019
@erikgaal erikgaal changed the title [3.0] Implement field option to set as nullable for create input type Implement field option to set as nullable for create input type Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants