Closed adnjoo closed 3 weeks ago
belongs_to :owner, class_name: "User", foreign_key: :user_id
has_many :notes_users
has_many :users, through: :notes_users
Note
User
has_many :notes, through: :notes_users
has_many :owned_notes, class_name: "Note", foreign_key: :user_id
104
Summary of Pull Request
Changed Files:
belongs_to :owner, class_name: "User", foreign_key: :user_id
.has_many :notes_users
andhas_many :users, through: :notes_users
.Note
andUser
.has_many :notes_users
andhas_many :notes, through: :notes_users
.has_many :owned_notes, class_name: "Note", foreign_key: :user_id
.