json_api_client icon indicating copy to clipboard operation
json_api_client copied to clipboard

Incorrect documentation for #create return value

Open m1foley opened this issue 4 years ago • 0 comments

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: https://github.com/JsonApiClient/json_api_client/blob/9b9835bab0c03d29209d6006ce7602da255bfcb1/lib/json_api_client/resource.rb#L168

m1foley avatar Jul 19 '21 19:07 m1foley