Rails throwing error: Association named 'media' was not found on User; perhaps you misspelled it? -
So I'm trying to find all users who have made a comment under the same picture. The psql terminal I write it and it gives me all the information that I need: select * Come to the users, users.id = comments.user_id in the media Media to join .ID = Comments can include internal media. Media_id where media_id = 1 I am currently doing this in the rail: @users = User.joins (: Comments: Media) .where (Media_id = @ medium.id) I should work. But when trying to print all the usernames from my code in @ , this error is thrown: The association named 'Media' Not found on user; Maybe you misspelled it? Did I do wrong work in my pen? DB Schema: create_table "media", force: true do | T | # Unrecognized columns using t.integer "user_id" end add_index "media", ["user_id"], name: "index_media_on_user_id", :: btree create_table "comments", force: true do | T | # Indispensable column t.integer "user_...