opscode/supermarket — pull request #630 by brettchalupa (2014-07-22 17:07:06+00:00)
Title: Display pending requests

:construction_worker:

This PR is grouped into two separate parts:

- displaying the pending requests a user has made in the Manage Profile > Agreements tab
- displaying the pending requests for an organization in the "Requests to Join" tab (just think, eventually org admins could totes accept or decline requests from here :astonished:)

The commit history is kind of odd - each part of how I progressed through the specs + code are their own commit. I will prob squash this into two commits when all is said and done - one for the user, one for the org.

I feel like the `User#pending_contributor_requests` and `Organization#pending_requests_to_join` are a lil similar. I was also wonder how Demeter would feel? Am I breaking his law? Could it be done with SQL instead? I am eager loading the various associations that I know are to be used in the views. Should I write specs for that eager loading?

The lists are currently displayed as simple `ul`s, which I think suffices. Here is what it looks like:

![screen shot 2014-07-22 at 11 26 18 am](https://cloud.githubusercontent.com/assets/928367/3661628/8977c3f4-11c2-11e4-9256-b5c4409812d6.png)

![screen shot 2014-07-22 at 12 38 56 pm](https://cloud.githubusercontent.com/assets/928367/3661629/8cd1c9dc-11c2-11e4-9ac6-4a4967d6485e.png)

todo:

- document dem two methods on `User` and `Organization`
- see if dem two methods could be "better'