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

Add compile-time error when passing a raw Hash in to SaveOperation.create/update #485

Merged
merged 1 commit into from
Oct 16, 2020

Conversation

jwoertink
Copy link
Member

@jwoertink jwoertink commented Oct 16, 2020

Fixes #313

A part of the #369 series. This is just an extra development level catch in case you pass a raw hash in to a SaveOperation create or update. I tested this by adding a spec that does it.

Screen Shot 2020-10-16 at 12 47 31 PM

On a side note, testing compile-time errors is impossible. I wonder if we should create a spec directory with commented out tests that would be designed for just having a way to make sure they work the way we think... 🤔 it would be a little weird and messy, but something to think about.

Copy link
Member

@matthewmcgarvey matthewmcgarvey left a comment

Choose a reason for hiding this comment

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

Looks good. Check out icy-arctic-fox/spectator#15 we might actually be able to test compilation errors

@jwoertink
Copy link
Member Author

oh that's nice. That would be great for us to have something like that. Maybe we use that in a separate shard we can include in all our projects for testing that stuff?

@jwoertink jwoertink merged commit 8a9cac8 into master Oct 16, 2020
@jwoertink jwoertink deleted the issues/313 branch October 16, 2020 21:03
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.

When you try to pass a hash to operation methods like create/update, show how to use named args instead
2 participants