hex337 / quantum-attendance

An attendance program for Quantum Martial Arts
MIT License
3 stars 2 forks source link

Use jsonbuilder to make a better class json model #7

Open hex337 opened 7 years ago

hex337 commented 7 years ago

Right now, we only return the info stored in the meeting object when requesting a meeting by id in json format. We need to return a whole host of other info, including the meeting members, their roles, and probably school information.

This is in regards to what we get when hitting /meetings/1.json

A format like this maybe:

{
  "id": 1,
  "instructor": {
    "id": 1,
    "name": "rachel evans",
    ...
  },
  "assistants": [
    {
      "id": 2,
      "name": "alex Kleissner",
      ...
    },
    ...
  ],
  "students": [
    {
      "id": 3,
      ...
    },
    ...
  ],
  "class_type": {
    "id": 1,
    "name": "Sparring",
  },
  "display_name": "Monday Night Sparring",
  "met_date": "2017-06-22 18:00"
}
hex337 commented 7 years ago

@mlamina did you want to take a stab at this? Would be a good opportunity to learn the data model better.

mlamina commented 7 years ago

@hex337 I'm on vacation in Berlin right now, don't have much time to work in this at the moment :-/

hex337 commented 7 years ago

There's no rush on this, but if it ends up blocking me, I'll take it :)