Open thenickcox opened 11 years ago
Haven't thought about it at all. Seems like it makes even more sense to move in the 'objects' direction rather than the 'class method' direction we started with.
I'm curious about what you mean by 'moving in the objects direction'? I feel like having the query methods as class methods seems mirror what I would expect from ORMs.
If these search terms are also somehow chain-able it seems like it might solve the, pagination issues with other models as well if you can just tack the page number and number of results on that chain.
I was talking about https://github.com/steveklabnik/sunlight-congress/pull/16 , but be warned: I have pretty extreme jetlag at the moment. ;)
As Joe and I were implementing the Vote functionality, we realized that in the API calls, queries can be chained. For example,
Unfortunately, we only implemented each attribute of the vote object returned individually. It looks like the
Bill
class was implemented the same way. We weren't immediately sure of how to make the methods chainable, because we would have to build up the API call out of strings that the methods returned, etc...we just decided to punt on that for now. How were we thinking of doing that, or has anyone broached that topic?