-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/fifth assignment #5
base: master
Are you sure you want to change the base?
Conversation
Removed captcha controller I created for the last assignment which was unnecessary
Change change method in drop_author to up, added down method
Important changes: add missing indices, finished 7th task
app/models/sub_reddit.rb
Outdated
| # | ||
|
|
||
| class SubReddit < ApplicationRecord | ||
| belongs_to :user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the user owner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that a SubReddit must have been created by someone, so the creator (a User) would be it's owner. If that's not the case, was the expected solution that every SubReddit owns many Users (a.k.a. has subscribers) and every User belongs to many SubReddits (a.k.a. is subscribed to many)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but this by default makes rails look for user_id. If you want to access your user as an "owner" method, you need specify it like belongs_to :owner, class_name: 'User'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are any database changes necessary for this or is that it?
|
Some of the features you are using don't work in SQLite database. For now let's keep it in SQLite, but we will probably migrate to postgreSQL in future assignments. |
Problems I'm not sure if I was supposed to solve now, as it is not explicitly specified:
Problems I don't know how to solve (but it makes sense that it should work, although I'm not sure it has to):
I'm pretty sure that most of these problems have obvious solutions, it's just that I don't see them.
Assignment