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

OptionsRequired to CastAssoc #33

Merged
merged 4 commits into from
Oct 8, 2018
Merged

OptionsRequired to CastAssoc #33

merged 4 commits into from
Oct 8, 2018

Conversation

dkiswanto
Copy link
Contributor

Usage

CastAssoc(ch, "my_field", MyChange, changeset.AssocRequired(true))

Error

my_field is required

@dkiswanto dkiswanto changed the title add options required to cast assoc OptionsRequired to CastAssoc Oct 5, 2018
@@ -52,3 +53,9 @@ func ChangeOnly(changeOnly bool) Option {
opts.changeOnly = changeOnly
}
}

func AssocRequired(required bool) Option {
Copy link
Owner

Choose a reason for hiding this comment

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

better to make it more generalize, Required

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

@Fs02 Fs02 merged commit ff85db4 into Fs02:master Oct 8, 2018
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