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

[Feature Request] Lazy Loading Chained where calls #408

Open
jlurena opened this issue Nov 13, 2024 · 1 comment
Open

[Feature Request] Lazy Loading Chained where calls #408

jlurena opened this issue Nov 13, 2024 · 1 comment

Comments

@jlurena
Copy link

jlurena commented Nov 13, 2024

Summary

I would like assistance implementing lazy HTTP calls for Collections.

Currently doing something like this:

# This makes two API calls.
result = MyActiveResourceModel.where(first_name: "John").where(last_name: "Doe")

Ideal scenario would be that:

# This makes 0 API call
result = MyActiveResourceModel.where(first_name: "John").where(last_name: "Doe")

# This makes 1 API call
result.to_a

# This makes 1 API call
result.any?
@jlurena
Copy link
Author

jlurena commented Nov 24, 2024

@byroot @rails I created a PR, would you mind having a look?

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