Rails Engine

Leah Miller
4 min readJan 28, 2019

They say “time heals all wounds,” but if they were developers, they’d probably say “time breaks all your tests.” I got it covered though.

Rails Engine was such a large undertaking and quite the intimidating start to Mod 3 at Turing.

We started with six different CSV files, containing a combined total of 35,714 lines of data, and each looks a little like this:

Gross.

To make the project a bit more manageable, I used waffle.io to break down each of my deliverables. I wanted to get through all of my finder methods for one complete category, just to make sure I understood how the routing worked. After that, I dove into the business intelligence data, as I wanted to make certain that my work on this lined up with our Advanced ActiveRecord lessons we had in class.

The ActiveRecord queries were pretty challenging. We only had 6 days to complete this project, so I certainly felt the pressure of the time crunch. On some of the queries, I paired with my cohort-mates and others, I gave it my best shot, but I did need to inject a fair amount of raw SQL. Given more time, I’d like to do a lot of refactoring; however, I do feel proud how much progress I’ve made in such a short time.

joins on joins on joins…

I’ve noticed that even though I’m getting better at predicting my own error messages, the error messages I now get that I haven’t been predicting are significantly more challenging to decipher. Take the below for instance:

This error means I’m missing a / in my URI. Obvious, right?

I haven’t always enjoyed having a lot of freedom in projects. As a new developer, part of what I want is for someone to tell me what to do, so that I don’t feel nervous that I’m doing the wrong thing. I’m getting better with the freedom though. This project allowed me to decide on which elements I wanted to focus, and which direction I wanted to take with my technical approach. Because of the size, I prioritized the business intelligence piece and saved the timestamp searches for last, as those tend to be a bit tricky. I tried to have some fun with the FactoryBot data too:

For any Arrested Development fans out there

I had a lot of fun learning about serializers and am really excited about how I implemented them in this project. One of the more challenging pieces of development for me is coming to the understanding that if something doesn’t exist, I can probably just create it. This project helped me work on that, and I think it’s pretty cool:

Custom controller rendering a custom serializer…whaaaat?!?!?!

I mentioned previously that if I had more time, I would certainly do some refactoring. I would dig into Spec Harness much sooner as well, as trying to go back and figure out why those tests are failing can be quite the headache.

Even though I did enjoy learning about serializers, I probably got a little overzealous creating them and that particular category of code could use some reorganization too. I might also rename some of my routes and controllers to be a bit more descriptive, though I do think most of what I have is fairly straightforward.

snippet from my routing file

Moving forward, I’m excited to continue API exploration and work on my own ActiveRecord practice too. Let’s go, Mod 3!

--

--