<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>ActiveRecord on Nicholas Shirley</title><link>https://nicholasshirley.com/categories/ActiveRecord/</link><description>Recent content in ActiveRecord on Nicholas Shirley</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 09 May 2019 09:04:42 +0000</lastBuildDate><atom:link href="https://nicholasshirley.com/categories/ActiveRecord/index.xml" rel="self" type="application/rss+xml"/><item><title>Verify That an ActiveRecord Object has at Least One Attribute</title><link>https://nicholasshirley.com/verify-that-an-activerecord-object-has-at-least-one-attribute/</link><pubDate>Thu, 09 May 2019 09:04:42 +0000</pubDate><guid>https://nicholasshirley.com/verify-that-an-activerecord-object-has-at-least-one-attribute/</guid><description>&lt;p&gt;Rails ActiveRecord callbacks make validation a breeze, but what happens if you want to verify that a record has at least one attribute present, but you don&amp;rsquo;t care which attribute it is? This was a recent case I was working on for a client who was having their operators fill in a form with a lot of uncertainty. They couldn&amp;rsquo;t know which record would be needed, but we didn&amp;rsquo;t want to allow all records to be blank.&lt;/p&gt;</description></item></channel></rss>