title: rails has_scope and sphinx search
body: <p>In my application I use <code>has_scope</code> gem and <code>thinking sphinx</code>, and in model I have written something like:</p>
  
  <pre><code>scope :by_description, -&gt; description { where("description like ?", "%#{description}%") if description.present?}
  </code></pre>
  
  <p>and then, In controller:</p>
  
  <pre><code>has_scope :by_description
  
  def somemimimi
    @cars = apply_scopes(Car).order(created_at: :desc).page(params[:page]).per(20)
  end
  </code></pre>
  
  <p>but when I tried to write something like:</p>
  
  <pre><code>scope :by_description, -&gt; description { search description}
  </code></pre>
  
  <p>I got the following error</p>
  
  <pre><code> you cannot search with Sphinx through ActiveRecord scopes
  </code></pre>
  
  <p>but I just search with sphinx too (when this param is presented), How can I solve this problem?</p>