How to prevent validation of self object
<p>Hi I have a method that check overlapping for new and updated objects.
Method:</p>

<pre><code>  def timeline
    if start_at_changed? || end_at_changed? || person_id_changed?
      if (person.vacations.where('start_at &lt;= ?', start_at).count &gt; 0 &amp;&amp;
         person.vacations.where('end_at &gt;= ?', end_at).count &gt; 0) ||
         (person.vacations.where('start_at &lt;= ?', start_at).count &gt; 0 &amp;&amp;
          person.vacations.where('end_at &lt;= ?', end_at).count &gt; 0 &amp;&amp;
          person.vacations.where('end_at &gt;= ?', start_at).count &gt; 0) ||
         (person.vacations.where('start_at &gt;= ?', start_at).count &gt; 0 &amp;&amp;
       person.vacations.where('start_at &lt;= ?', end_at).count &gt; 0 &amp;&amp;
         person.vacations.where('end_at &gt;= ?', end_at).count &gt; 0) 
        errors.add(:base, 'You have a vacation during this period.')
      end
    end
  end
</code></pre>

<p>My issue is while I try edit some vacation. If I change e.g. start_at validation checks also this object and return error. Example: start_at 2016-06-27, end_at: 2016-06-30. I try change start_at to 2016-06-26. Validation returns 'You have a vacation during this period.', because it check period 2016-06-27 - 2016-06-30.  How to exclude checking object that I try update, only other?</p>