You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the org home page, we see some feature pets. Let's improve this:
this section should render conditionally, and only show if the collection of pets passed to the view is not empty
if you look at the controller, the @pets collection query should be improved. The collection is set using a sample of 4, but this fails when the available pets is less than 4, because it starts to duplicate. So, I think we need a check there to see if the total number of adoptable pets is greater than 4, then sample 4, otherwise, return all pets (could be 1, 2, or 3 in total). Note, we do not need this line in the query .where(organization: Current.organization) because all Pet queries in this controller scope are already scoped to the tenant. Finally please use the Pet.unadopted scope to only return adoptable pets.
try uploading images of different sizes and you will see the cards end up being slightly different heights based on the uploaded image, so please enforce a consistent height for all images that display in the cards
Example of different height images, that should be the same height
The text was updated successfully, but these errors were encountered:
On the org home page, we see some feature pets. Let's improve this:
@pets
collection query should be improved. The collection is set using a sample of 4, but this fails when the available pets is less than 4, because it starts to duplicate. So, I think we need a check there to see if the total number of adoptable pets is greater than 4, then sample 4, otherwise, return all pets (could be 1, 2, or 3 in total). Note, we do not need this line in the query.where(organization: Current.organization)
because all Pet queries in this controller scope are already scoped to the tenant. Finally please use thePet.unadopted
scope to only return adoptable pets.Example of different height images, that should be the same height
The text was updated successfully, but these errors were encountered: