commonplaceusa / commonplace

COMMUNITY!
www.commonplaceusa.com
3 stars 0 forks source link

Split lib/api.rb into modules #63

Closed maxtilford closed 13 years ago

maxtilford commented 13 years ago

That big file and it's counterpart spec/lib/api_spec.rb are getting unwieldy

We could split it several different ways:

  1. By HTTP method (POST, GET, DELETE, PUT)
    • I don't like that idea, so we end up with four files. We'll run into the same problem eventually
  2. By top-most resource. We have a file for everything under /communities, one for everything under /accounts, etc.
    • I like this one, but for example, /posts won't be grouped with /communities/:id/posts
  3. By bottom-most resource. A file would have /communities/:id/posts, and /posts/:id, and /groups/:id/posts, and /users/:id/posts

Either 2 or 3 would be the way to go.

maxtilford commented 13 years ago

Success!