title: Refactoring to get attributes from self or parent
body: <p>class <code>Shop</code> is potentially a child as it <code>belongs_to :chain, , optional: true</code></p>
  <p>The chain has <code>chain_rules</code> which apply to the shop if true.</p>
  <p>To avoid re-writing patterns for a multiple attributes of both chain and shop, a class method</p>
  <pre><code>  def shop_rule
      if self.chain_id &amp;&amp; self.chain.chain_rules
        self.chain
      else
        self
      end
    end
  </code></pre>
  <p>However in the console calling <code>shop.shop_rule.attribute</code>, the following error is generated:
  <code>undefined method </code>shop_rule' for #&lt;Shop: ...`</p>
  <p>How should this be defined then?</p>