title: Rails counter cache with condition
body: <p>I have a rails hotel application which has rooms inside it. Rooms can have n number of tickets associated to them. I have create a counter cache with counter culture gem which updates the room table with number of tickets assigned to it,
  the problem is i only want count of tickets which are open or in progress state. I have this code it works fine normally but does not work with the condition can anyone guide me by letting me know how can i work it with conditions? Any help is appreciated</p>
  
  <p>Room Table Migration file</p>
  
  <pre><code> class AddTicketsCountToRooms &lt; ActiveRecord::Migration[5.0]
      def self.up
        add_column :rooms, :tickets_count, :integer, null: false, default: 0
      end
    end
  </code></pre>
  
  <p>Ticket.rb file</p>
  
  <pre><code>    belongs_to :room
    counter_culture :room, column_name: proc {|model| model.status? [0,1] 'tickets_count' : nil }
  </code></pre>
  
  <p>This does not go according to the where clause and 
  gives me error saying</p>
  
  <pre><code>syntax error, unexpected tSTRING_BEG, expecting '}' {|model| model.status? [0,1] 'tickets_count' : nil } ^ /Users/mohammedsayerwala/Documents/Aqua/app/models/ticket.rb:8: syntax error, unexpected ':', expecting keyword_end tatus? [0,1] 'tickets_count' : nil }
  </code></pre>