title: rails, syntax error, unexpected ','
body: <p>I have several conditions in my search.</p>
  
  <pre><code>@events = Event.search(params[:search], 
    :conditions =&gt; {:group_size =&gt; 1, :days =&gt; 1})
  </code></pre>
  
  <p>The above code is working fine. However, if I want to replace the hash with a private method, I get syntax error</p>
  
  <pre><code>syntax error, unexpected ',', expecting tASSOC
      :conditions =&gt; {group_size_condition, :days =&gt; 1},
  </code></pre>
  
  <p>Code is as follow</p>
  
  <pre><code>@events = Event.search(params[:search], 
    :conditions =&gt; {group_size_condition, :days =&gt; 1})
  
  private
  
  def group_size_condition
    if params[:groupsize] == 'single (1)'
      :group_size =&gt; 1
    elsif params[:groupsize] == 'couple (2)'
      :group_size =&gt; 2
    elsif params[:groupsize] == 'small group(3-5)'
      :group_size =&gt; 3..5
    else
      nil
    end
  end
  </code></pre>
  
  <p>Thanks in advance</p>