title: Find with condition in Rails
body: <p>I am working on a project where users can create events with limited seats, and register and attend other events.</p>
  
  <p>So far, I have an event, user, and seat model. And have removed the ability for users to create duplicate seats in my Seat model.</p>
  
  <pre><code>class Event &lt; ActiveRecord::Base
    validates :title, :from_date, :from_time, :number_of_seats, presence: true
    belongs_to :user
    has_many :seats
  end
  
  class Seat &lt; ActiveRecord::Base
    validates :event_id, :user_id, presence: true
    validates_uniqueness_of :user_id, :scope =&gt; :event_id
    belongs_to :event
    belongs_to :user
  end
  </code></pre>
  
  <p>Currently, I have a page that lists all the available events. What I am trying to do is create a query of all the events the user is attending, and remove them from the page (or let the user know they are already attending).</p>
  
  <p>I was able to create a page of all the classes a user is attending with this in my seats controller:</p>
  
  <pre><code>def index
    @seats = Seat.where(user_id: current_user.id)
  end
  </code></pre>
  
  <p>And this on the page:</p>
  
  <pre><code>&lt;h1 class="page-header"&gt;My Classes&lt;/h1&gt;
      &lt;% @seats.each do |p| %&gt;
          &lt;%= link_to Event.find(p.event_id).title, p %&gt;
      &lt;% end %&gt;
  </code></pre>
  
  <p>I have tried solving this problem using <a href="https://stackoverflow.com/questions/26370829/rails-find-with-condition-in-rails-4">Find with conditions: Stack Overflow</a></p>
  
  <p>It got me close, but no cigar...</p>
  
  <p>How can I create an Active Record Query that returns all Events a user is NOT attending?</p>