DEV Community

Discussion on: Ruby on Rails .create Rollback Mystery

Collapse
 
elmarshall profile image
El Marshall (she/they)

Ooh, we should talk some time about the images thing, I'd like to implement some proper image storage for one of my projects.

As for why it's syntactically correct... I'll be honest, it's just what I was told. Didn't question it much, maybe I should have, haha. My guess is that it's more intuitive and clearer. Walking into this code totally fresh, someone can now see, ok, these are foreign keys connecting this to other models. Without that marker, someone unfamiliar with the program would have to do a bit of searching to understand what was up.

Collapse
 
racheladaw profile image
Rachel Williams

Yeah definitely! I mostly followed this blog which is pretty straightforward. I also blogged about the process and how I implemented it in my app.

Ah okay that makes sense. I realize I would be confused too if I hadn't learned about ActiveRecord before reading the code. It definitely makes it more clear.