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

count could be size , so that when it's loaded, the size will be faster than count #186

Open
lelelelemon opened this issue Aug 23, 2017 · 3 comments

Comments

@lelelelemon
Copy link
Collaborator

ror_ecommerce/app/views/admin/users/show.html.erb:22:

  • # of Items<%= shipment.order_items.count %>
  • @drhenner
    Copy link
    Owner

    👍

    @drhenner
    Copy link
    Owner

    After looking

       User.includes([:shipments, :finished_orders, :return_authorizations])
    

    I would have to have :shipments => [:order_items] in the includes. Unless I'm missing something :order_items aren't loaded so doing count might be better and from a memory footprint not loading the order_items is definitely better.

    @lelelelemon
    Copy link
    Collaborator Author

    right, this will also be a good solution

    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

    2 participants