Javascript Feature Test With RSpec

The application is a Rails API backend with a Javascript frontend, in a single GitHub repository. All the Rails testing for models and controllers is done with RSpec. For expediency, I thought I’d try RSpec to perform feature tests on the javascript frontend rather than add a second testing framework. Through a lot of trial […]

Active Record SQL & Explain Plan

I have an app that retrieves 640 data points from a Postgres database with a two-table join. The join was taking about 3 minutes to return results, so I decided to see if that could be improved. I examined the query plans and added a distinct clause to the query. This dropped the query response time […]

Active Record Preload

I have an app that retrieves 640 data points from a database (from the Series table) that are then rendered to JSON and sent to the client to be plotted on a chart. Active Record assembles an object from one or more database records. Since the Series class includes the Instrument class, each Series object […]

Active Model Serializers & JSON Sideloading

Depending on the application, JSON data transfers can be costly in terms of response time and data size. When your data model has nested associations, each association gets fully converted into JSON. This can lead to a lot of duplicated data being serialized and transmitted. Sideloading repetitive association data is a way to reduce JSON payloads and […]

Using Database Transactions

When we use a relational database, we are using database transactions. By default, every SQL statement (select, insert, update, etc.) executes within its own transaction. A transaction incurs a lot of overhead. When we need to process lots of SQL statements at a time, our application’s performance can suffer greatly. Background A database transaction represents […]

The React Redux Portfolio Project

The goal of this project was to create an app using as much of what we have learned as possible. It needed to utilize React and Redux, ES6 syntax, and communicate with a Rails backend. I chose to write a stock portfolio valuation tool similar to what you’d see on Yahoo Finance, or at an […]

Rails App with a jQuery Front End

For this project, we were to take our pre-existing Rails app (written without using JSON or Ajax), and rewrite all or part of it using JSON and Ajax. My previous Rails project was Recipe Cat, a recipe catalog application. It makes extensive use of Embedded Ruby (ERB) pages and is pretty tightly coupled with the […]

The Rails Portfolio Project

This is the first do-it-yourself from scratch Rails coding project. The previous projects were kind of paint-by-the-numbers, where you’re completing a part of an existing project or being guided as to what to create. This project had a brief description of what the project needed to satify the Rails Assessment requirements. For my project, I chose to […]