Skip to content

[Feature Request] Lazy Loading Chained where calls #408

@jlurena

Description

@jlurena

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?

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