title: Adding to a column in MySql using .where method for a rails validation/comparison
body: <p>I am having trouble adding to a column in MySql using a .where method for the purpose of comparing. Here is the following code:</p>
  
  <pre><code>        def find_conflicting(event, location, room_ids, start_time, end_time, exclude_statuses = [LOST])
          return [] if room_ids.blank? || start_time.blank? || end_time.blank? || location.blank?
  
          full_room_ids = location.room_dependencies(*room_ids.map(&amp;:to_i))
          o = joins(:rooms).where{ (rooms.id &gt;&gt; my{full_room_ids}) &amp; (status &lt;&lt; my{exclude_statuses}) }.group('events.id')
          o = o.where( :event_start.lt =&gt; (end_time + event.teardown_time.minutes), :event_end.gt =&gt; (start_time - event.setup_time.minutes) )
          o = o.where{ id != my{event.id} } unless event.nil? || event.new_record?
          o.to_a
          end
  </code></pre>
  
  <p>The jist is that I am trying to find conflicting events. Except when I try to convert event_start (which is a dateTime object) into a time, then add time to it much like the following line of code:</p>
  
  <pre><code>(end_time + event.teardown_time.minutes)
  </code></pre>
  
  <p>I keep on getting the following error:  Mysql2::Error - Unknown column 'event_start.time' in 'where clause. Any idea on how to add time on it for the comparison? I understand the error, as say event_start.time is not a column, but all I am looking for is adding time just for a comparison. Any and all help is appreciated. Cheers~</p>