Systems | Development | Analytics | API | Testing

Rails

Optimistic Locking in Rails REST APIs

Imagine the following hypothetical scenario: in a rental property management system, Employee A starts editing contact info for Rental X, adding some extra phone numbers. Around the same time, Employee B notices a typo in the contact info for exactly that Rental X and performs an update. A couple of minutes later, Employee A updates Rental X’s contact info with the new phone numbers, and … the update fixing the typo is now gone! That’s definitely not great!

Multi-Factor Authentication for Rails With WebAuthn and Devise

If someone steals your password, they can pretend to be you. That's why many companies provide two-factor or multi-factor authentication via a fingerprint scan, a YubiKey, an authenticator app, or SMS. In this article, Petr Hlavicka will give you a solid foundation of knowledge about multi-factor authentication and will walk you through implementation with Rails, Webauthn, and Devise

Building A Full-Stack Application With Vue, Vuex and Rails

Vue is a popular front-end that is especially useful for Rails developers since it was designed to be incrementally adoptable. That means you can use Vue for parts of your UI without having to rebuild everything from scratch. In this article, John Emmanual will introduce us to Vue, show us how to set it up in Rails, and walk us through a simple project.

Using ActiveRecord's #update_counters to Prevent Race Conditions

Race conditions are arguably the most insidious kind of bug; they're intermittent, subtle, and most likely to occur in production. ActiveRecord's `update_counter` provides us with a convenient way to avoid race conditions when incrementing or decrementing values in the database. In this article, Jonathan Miles shows us how to use it, how it's implemented, and other approaches to avoiding race conditions.