Created
November 8, 2023 22:21
-
-
Save thefactus/f426b9de1976b474ca8b04fee375b79c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ApplicationRecord | |
has_many :user_todo_lists | |
has_many :todo_lists, through: :user_todo_lists | |
has_many :todos, through: :todo_lists | |
end | |
class UserTodoList < ApplicationRecord | |
belongs_to :user | |
belongs_to :todo_list | |
end | |
class TodoList < ApplicationRecord | |
has_many :user_todo_lists | |
has_many :users, through: :user_todo_lists | |
has_many :todos | |
end | |
class Todo < ApplicationRecord | |
belongs_to :todo_list | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment