0

I'm a new with Rails and I'm having trouble with some types of associations that seem a bit more complex than the ones I've been exposed to so far.

Zombie_users      Body_parts_status                              Body_parts

| id | name |     | id | user_id | body_part_id | recovery |     | id | name     |
|-----------| --> |----------------------------------------| --> |---------------|
| 1  | Joe  |     | 1 |    1     |     2        |   10%    |     | 1  | left leg |
| 2  | Max  |     | 2 |    1     |     3        |   43%    |     | 2  | brain    |
                                                                 | 3  | hair     |
                                                                 | 4  | blue eye |


Zobmie_users    Recovery_tools          Body_parts_impacts

| id | name |   | id |user_id| name |   | id|recovery_tool_id| body_part_id | impact |
|-----------|-->|-------------------|-->|--------------------------------------------|
| 1  | Joe  |   | 1  |   1   |hammer|   | 1 |       1        |      2       |   10%  |
| 2  | Max  |   | 2  |   1   |magic |   | 2 |       2        |      3       |   43%  |

graphic illustration of the needed functionality

We have users and a list of body parts. I need that the users will be able to create recovery tools with which they can through Body Parts impact recover their body parts status :) and be able to check what part of the body still need to be fixed(compared to the list) and what body parts they have already corrected.

My problem is that I do not know how to implement such connections. because I need to have some kind of clone of the body parts to body parts status for each user. But how I reference it so it also works with Body Parts impacts I do not have even a concept of where to start :)

body parts table is just a long listing of all the parts of the human body and each user should have their own "copy" of all these parts.

GEkk
  • 1,336
  • 11
  • 20
  • There are several problems to be solved here. You might want to break this up into smaller questions. – ahmacleod Sep 16 '15 at 05:30
  • Thank you @ahmacleod this is good advice, the only complexity of formulating the questions :) – GEkk Sep 16 '15 at 05:41

0 Answers0