Conversation
| @@ -0,0 +1,6 @@ | |||
| class Relation < ApplicationRecord | |||
There was a problem hiding this comment.
Small tip for future:
This name Relation is too generic.
The default convention for join table name is based on 2 table names:
books table and characters table have join table with name containing both table names in alphabetic order so books go first, then join table name is books_characters. Similar example here https://guides.rubyonrails.org/association_basics.html#the-has-and-belongs-to-many-association
The model for such join table would be BookCharacter but of course, we could use some custom name that's more explicit in domain problem as in the example with Appointments here https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association
| @@ -0,0 +1,29 @@ | |||
| class BookCharactersCreator | |||
| def initialize | |||
There was a problem hiding this comment.
you can remove the definition of the empty constructor, it's by default like that without writing it :)
This is an exercise PR, it won't be merged to master. Contains two versions of solution, committed separately.
https://trello.com/c/7W1s8quQ