News for hackers. Stuff that matters.
Re:My time with Rails is up by qaq on Sunday May 22, 2016 @01:57PM (#11749534)
There are always pros/cons to any approach one can as easily argue that without AR your code is less DRY as you need to keep your models in sync with your DB schema manually. (I am not a fan of AR either)
Re:My time with Rails is up by majewsky on Sunday May 22, 2016 @05:30PM (#11750368)
You could easily build a unit test that compares the set of exposed properties of your model class with the columns of the table in your test DB.
Re:My time with Rails is up by qaq on Sunday May 22, 2016 @05:58PM (#11750465)
That's not really a unit test and not really a good idea to do it this way. You'll still have to keep model in sync with schema you'll just know when they diverge.
Re:My time with Rails is up by eropple on Tuesday May 24, 2016 @01:53AM (#11759232)
If that's a concern, invert it and create tables off of your object model. It's Ruby, that's trivial.