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

Fix send nil value when creating an entity #161

Merged
merged 1 commit into from
Mar 15, 2015

Conversation

AlfonsoUceda
Copy link
Contributor

This is @jodosha 's work, He told me finish the PR:

reference #155 #156

@AlfonsoUceda
Copy link
Contributor Author

@lotus/core-team @7even @luishurtado

coercer.to_record(entity).must_equal(name: 'Daenerys Targaryen')
end

it 'forces nil values' do
Copy link
Member

Choose a reason for hiding this comment

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

i am confused with the description, should it be it ignores nil values on creating?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO this describe block is when you create new record, we test two cases, new entity without forcing an attribute to nil and another case forcing a nil attribute.

to_record method translate the entity to a format compatible with the database, then nil attributes shouldn't be sent when are creating a entity, but in this case you don't persirst an entity, only we are testing to_record method getting the correct values

runlevel5 pushed a commit that referenced this pull request Mar 15, 2015
Fix send nil value when creating an entity
@runlevel5 runlevel5 merged commit 80b40a0 into hanami:master Mar 15, 2015
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.

None yet

5 participants