Skip to content

Active record esque find #5

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

Closed

Conversation

maliabadi
Copy link

No description provided.

@chingor13
Copy link
Collaborator

This will change the behavior of find.

The tests pass because you've added .first to the resource instance which was not the intent.

find() in this world should always return a ResultSet which is array-ish.

If we're trying to mimic the behavior of ActiveRecord, I contend that overloading find() to return different return types is not correct. If we want to have a way to grab the first thing or nothing we can add a separate endpoint for this (perhaps find_one?)

@maliabadi
Copy link
Author

withdrawn

@maliabadi maliabadi closed this May 30, 2014
raldred pushed a commit to residently/json_api_client that referenced this pull request May 3, 2023
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