I created a model called UserHasMessages based on some SO postings. I think this seems to be creating some challenges for me:
-
How do I reference it with
has_many? Should I use has_many:user_has_messageses? -
How do I do joins? I have tried User.joins(:user_has_messages) and it is sad 🙁
Question:
Should I somehow change the name to UserHasMessage, and if so, how?
If I keep as plural, how do I handle these cases?
You could add a new migration
inside it you write:
(the table is always plural)
Run the migration.
Rename your file from
user_has_messages.rbtouser_message.rb, and rename your class fromUserHasMessagestoUserMessage.Done 🙂