Learn how to strike a balance between flexibility and data integrity with a partial index and validations.
Running a separate query to count how many records are associated with another record is inefficient. Using a counter cache can save the day!
Learn how to improve the interface of your existing Active Record Models with this underutilized API.
Learn about an unexpected limitation with this API and how to combat it universally.
It’s all about databases in this edition!
How do you even save a “duration”, let alone query for records by that value? It’s actually easier than you think.
Search through user-provided HTML content with PostgreSQL and Active Record.
Extract common clauses when using Active Record’s .or method.