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

Completed #22

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

Completed #22

wants to merge 1 commit into from

Conversation

BigSpaces
Copy link
Owner

No description provided.

Copy link

@BrooklinJazz BrooklinJazz left a comment

Choose a reason for hiding this comment

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

Amazing 🤩🤩🤩🤩

I like this better than the current example solution. Would love a PR if you have time to use your solution as the example solution.

|> Ecto.Changeset.validate_required([:title, :content])
|> Ecto.Changeset.validate_inclusion(:category, ["action", "fiction", "mystery"])
|> Ecto.Changeset.validate_number(:books_sold, greater_than_or_equal_to: 0)
|> Ecto.Changeset.validate_format(:publisher_email, @mail_regex)

Choose a reason for hiding this comment

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

This is better than the example solution! I should have used validate_format but instead wrote a custom validation.

Would you be interested in making a PR to make this the example solution?

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