In RoR with relationships being defined in the model, does this imply that the DB itself is part of the model?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The database (or any data store, in a more generic sense outside of standard use of the Ruby On Rails framework) is the persistence in which models are kept in storage.
Think of the models as “active” things which interact and respond to commands and exhibit behavior consistent with business logic. If a model needs to be made “inactive” (to conserve memory, or because it’s no longer logically in the scope of what’s happening, etc.) then data which represents the attributes of the model is persisted to a data store.
Note the difference. The model (or entity) itself isn’t persisted to the data store. Attributes which represent (or describe) the model are persisted to the data store. Enough information about the model to reconstruct it in its current state at a later time.