Skip to content

Incorrect documentation for #create return value #384

Description

@m1foley

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions