How does Rails associate a Model with a Migration?

In the latest video from Intro to Rails workshop (Rails Models) we run the CreateDecks migration and then proceed to create our deck model (Deck class). Immediately after this,when in the rails console, our model is already associated with our migration without requiring any action from us, so my question is, how is this association being made? Is it through the class/file names?

My best guess is that CreateDecks migration will be associated with the Deck model, is this correct?

Thanks in advance

Can you clarify what you mean by the migration being associated with Deck?

Rails certainly does use a lot of conventions where the name of things set some things up for you automatically. For example, Rails will expect that a Deck object will be saved in and retrieved from a table called decks.

I’m not sure if that’s what you’re asking though. Can you be more specific?

Yeah that’s what I was asking. I didn’t understand what part of the CreateDecks migration was making Rails expect that there would be Deck objects. I guess i didn’t explain myself very well.