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

Incorrect documentation for #create return value #384

Open
m1foley opened this issue Jul 19, 2021 · 0 comments
Open

Incorrect documentation for #create return value #384

m1foley opened this issue Jul 19, 2021 · 0 comments

Comments

@m1foley
Copy link

m1foley commented Jul 19, 2021

The "Validation Errors" section of the readme says that create returns a falsey value on errors:

User.create(name: "Bob", email_address: "invalid email")
# => false

This is incorrect: create actually returns the set of attributes regardless of success status. This code comment above the create method is correct:

# @return [Resource] The instance you tried to create. You will have to check the persisted state or errors on this object to see success/failure.

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

No branches or pull requests

1 participant