-
Notifications
You must be signed in to change notification settings - Fork 121
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
Org root page: add browse species buttons conditionally #1081
Comments
@kasugaijin I'd be happy to take this issue |
@Yuji3000 all yours |
Just to point out/clarify, the Pet model is scoped to the current organization using acts_as_tenant. @kasugaijin I think using |
@jmilljr24 I think |
@Yuji3000 let us know if you have any questions! |
@kasugaijin thank you |
@Yuji3000 are you still able to work on this? Let me know if not and I can reassign. |
Currently, the browse cats and browse dogs buttons are hard coded. However, not every organization is going to have both cats and dogs. So, we should build the necessary buttons based on the unique pet species represented in the organization.
For example, if you queried the unique species on all pet records for a given org, and it returned only 'dog', then we should only show a dog button...and so on.
I was thinking about what we should do when there are no adoptable pets for a given species. For now, let's still show the button, but we should show an empty state. This related issue is adding empty states.
Regarding implementation, we will be handling this in the
Organizations::HomeController
. I think we should add a scope onPet
called something likeorganization_species
that returns a list of unique species for the org. Then we can use this list to build the buttons.The text was updated successfully, but these errors were encountered: