Automatic Breadcrumbs in Ember.js

By Dan Freeman on Sep 25, 2014 3:21:32 PM

Over the past few months at Salsify we've spent some time exploring Ember.js and incorporating it into parts of our front-end. There's a lot to say on the topic, but today we'll just be taking a look at one of our first forays outside of the land of Ember's baked-in pieces: automatically generating breadcrumbs based on a user's application state.

Read More →

Automatic Eager Loading in Rails

By Joel Turkel on Jun 17, 2014 1:24:00 PM

Most Rails developers quickly learn that minimizing the number of database queries by properly specifying eager loads is critical for good application performance. Unfortunately specifying eager loads is error prone and can cause encapsulation problems. In this post we'll explore having Rails automatically handle eager loads.

Read More →

Tearing Down Capybara Tests of AJAX Pages

By Joel Turkel on May 3, 2014 8:00:00 AM

At Salsify we write lots of Capybara integration tests of our single-page app. These tests are a key part of the infrastructure that allow us to move fast and refactor without break anything. Unfortunately as we added more and more tests we started experiencing sporadic hangs and database deadlocks while tearing down tests. After some investigation we figured out the problem was our JavaScript client making AJAX requests to our Rails server during the test teardown process. This post details our journey to stamp out these problems and get our tests running reliably again.  

Read More →

Active Record Migrations on Tables Leveraging STI

By Randy Burkes on Feb 5, 2014 8:57:00 AM

I wanted to share a bit of information that we found interesting when writing active record migrations on tables leveraging STI (Single Table Inheritance). We came across a not so obvious gotcha with STI models re-defined in migration classes and wanted to explore our thought process while solving the subsequent problems.

Read More →

Eager Loading Calculations With Database Views In Rails - Revisited

By Joel Turkel on Dec 12, 2013 4:45:00 AM

Previously we blogged about eager loading calculations with database views in Rails to avoid running lots of database queries. The approach we described really only works if your SQL is fairly static and you don't mind creating database views for each of your calculations. In this post we'll explore an alternative approach that avoids these issues by not using database views. First let's quickly recap the problem...

Read More →

Don't Fear the Reaper: Detecting Failed Delayed Job Workers

By Joel Turkel on Oct 30, 2013 6:15:00 AM

Update: The plugin discussed in this post has been packaged into the delayed_job_heartbeat_plugin gem.

Previously we've blogged about how to write Delayed Job plugins and how to aggregate jobs into job groups. In this post we'll explore how to proactively detect failed Delayed Job workers so their jobs can be retried in a timely manner. This is useful if a worker crashes, is automatically restarted by your platform provider, or is shutdown by auto-scaling infrastructure.

Read More →

Invoking Super Methods in JavaScript

By Dan Freeman on Oct 17, 2013 1:15:00 PM

For newcomers to JavaScript, the language's prototypical inheritance model is often a source of confusion, particularly for those used to classical inheritance in languages like Java, C++, and Ruby. Right off the bat, new JS developers generally hit a few blocking questions:

Read More →

When Developers Collide! Resolving sequencing conflicts in ActiveRecord migrations

By Randy Burkes on Sep 12, 2013 5:22:00 AM

Here at Salsify we follow a git flow branching model, so it is common for us each to work independently on feature branches while regularly merging to and from a shared develop branch. We also routinely push code to staging and production environments for internal review and release. The combination of our fast-paced development environment and extensive use of branching occasionally results in conflicts when landing new features. We recently encountered one of these conflicts (sequencing not code) in a pair of ActiveRecord migrations and found a workaround we thought might be useful to others. The following migration excerpts were written on two different branches:

Read More →

Data Binding in Backbone with Epoxy

By Dan Spangenberger on Aug 13, 2013 6:02:00 PM

At Salsify we're developing a single-page Javascript app backed by Rails. We've done so with Backbone, extending its functionality through various extension projects when needed (Marionette, Cocktail, etc). The project we've made the most use of lately is Epoxy, and that's what I'll talk about today.

Read More →

Adding Job Groups to Delayed Jobs

By Joel Turkel on Jul 29, 2013 5:47:00 PM

Recently I blogged about the Delayed Job plugin mechanism. In this post we'll explore how we can use this plugin mechanism to add job groups to Delayed Job allowing us to:

Read More →

Recent Posts