title: Active Record with Delegate and conditions
body: <p>Is it possible to use delegate in your Active Record model and use conditions like <code>:if</code> on it?</p>
  
  <pre><code>class User &lt; ApplicationRecord
    delegate :company, :to =&gt; :master, :if =&gt; :has_master?
  
    belongs_to :master, :class_name =&gt; "User"
  
    def has_master?
      master.present?
    end
  end
  </code></pre>