How to Set Up a Rails SAML Identity Provider

Security Assertion Markup Language (SAML) is a protocol for single sign-on. SAML handles communication between a service provider (SP) and an identity provider (IdP). The identity provider acts as an authentication and identification mechanism for service providers. In this post, I’ll walk you through setting up your Rails application as a SAML IdP. This post […]

Active Record Aggregate Fields via Sub-Selecting Scopes

I was recently working on a piece of code from a legacy Rails application. An unusually large number of queries being run on a particular page let me know there was an N+1 query lurking. The application was an online assessment platform dealing with assessments, questions, and responses. The question listing page was simply asking […]

A Few Tips For Getting Started With Rails

Rails does a lot of work for you. This is often beneficial, but when it makes assumptions that aren’t right for your app, it can be frustrating. In this post, I’ll discuss a few issues that can arise when you get started creating models, along with some easy solutions to them. Oh, and before I […]

Testing Data Migrations in Rails

When working on a Rails project, you will inevitably need to move data around in your database. Some join table value will need to be moved into its own table or what have you. When approaching these kinds of migrations, there are two major complications: future-proofing and testing. In this post, let’s walk through an […]