-
Notifications
You must be signed in to change notification settings - Fork 4
/
Mapping the models.txt
104 lines (72 loc) · 1.87 KB
/
Mapping the models.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
CloneBook Data Structures:
-New Users can sign up to join the site
-User can create multiple Posts
-User can can be friends with other members
-User can send requests to other members to be friends
-User can have many requests to be friends from other members
-Users can like other people's Posts (if they are friends)
-Users can comment on other people's Posts (if they are friends)
IMPLEMENT LATER :
#-Users can attend multiple Events
#-Events have have many Users attending
#-Forgot password link
#-Users can reset their password via email
MODELS:
MODEL - Users:
-first_name
-last_name
-email
-password_digest
has_many posts
has_many likes
has_many comments
has_many received_requests (foreign key: )
has_many sent_requests (foreign key: )
#-has_many Events created
#-has_many invites to others' Events
MODEL - Profile:
-belongs_to User
-avatar-photo
-birthday
-Location
-gender
-bio/about-me section
MODEL - Posts:
-content
-User_id
-belongs_to User
-has_many comments
-has_many likes
-has_attached_file (image)
MODEL - Likes:
-User_id
-Post_id
-belongs_to User
-belongs_to Post
MODEL - Comments:
-content
-User_id
-Post_id
-belongs_to User
-belongs_to Post
MODEL - Requests:
-belongs_to User_id (renamed to requester)
-belongs_to User_id (renamed to requestee)
-column Accepted (0/1/2 for each User)
0 - request has been sent
1 - request has been accepted, they are now friends
2 - request has been rejected, don't show request anymore
IMPLEMENT LATER :
MODEL - Events:
-belongs_to one Host
-title
-description
-date
-Location
-has_many Invites (each user)
-has_many Users attending (maybe not)
rails generate model Events name:string description:text location:string date:date user:references
MODEL - Invites:
-belongs_to Event_id (renamed to attended_event)
-belongs_to User_id (renamed to attendee)
-column Accepted (True/False for each User)