Unpoly's [up-observe], [up-autosubmit] and [up-validate] as well as their programmatic variants up.observe() and up.autosubmit...

When two classes implement the same behavior (methods, callbacks, etc.), you should extract that behavior into a trait or module...

postgresql.org

TL;DR PostgreSQL handles Rails 4+ text and string columns the same. Some libraries may still reflect on the column...

Ruby has two different ways to match the start and the end of a text: ^ (Start of line) and $ (End...

It is very common to parse dates from strings. It seems obvious to use Date.parse for this job. However this...

In the past we validate and set default values for boolean attributes in Rails and not the database itself.

CarrierWave comes with a set of default configuration options which make sense in most cases. However, you should review these...

There are several ways to run a single spec. I usually copy the spec file path with the line number...

makandra dev

There is a practical short list for valid/invalid example email addresses - Thanks to Florian L.! The definition for valid emails...

unpoly.com

Version 3.7.0 broke some things in complex forms. Sorry for that. Concurrent user input is hard. 3.7.1 This change fixes...

If the project team consists of at least 2 members, do a daily standup. It should not take much longer...

tl;dr Do not use the option optional on association declarations with a symbol, lambda or proc. Explanation Association declarations...

Since Rails 7 you are able to encrypt database information with Active Record. Using Active Record Encryption will store an...

If validations failed for a record, and you want to find out if a specific validation failed, you can leverage...

Use form models to handle this problem Or soften the validation to validates_presence_of :parent

validates_acceptance_of :terms only works if terms is set to a value. The validation is skipped silently when terms...

In Ruby you can communicate between processes with sockets. This might be helpful in tests that validate parallel executions or...

This is a personal post-mortem analysis of a project that was mainly build to provide a REST API to...

We have often felt the pain where our models need to serve too many masters. E.g. we are adding a...

makandra dev
litmus.com

The 90s are calling: they want their tables back. Unfortunately, you need them all for laying out your HTML emails...

If you require your Rails models manually, pay attention to the path you use. Unless you have...

Enumerable#all? returns true for an empty collection. This totally makes sense but you have to think about it when...

When you're developing a gem, never list the same dependency as both runtime and development dependency in your .gemspec...

Shoulda Matchers don't provide canditional validations (validations with if: option). Here is how to write tests for the condition...