dimanche 8 janvier 2017

Why in Rails table fields are defined in migrations but not in models?

I am studying Ruby on Rails and confused with structure of files and code.. Why in Rails table fields are defined in migrations but not in models? I know, what are models needed for. However rails like any framework is aimed to make developer work easier and put all dirty work under the hood. Moreover, we define relationships of database both in models and migrations? But we could define them just in one place and automatically transfer to another..

Aucun commentaire:

Enregistrer un commentaire