title: rails 5 search by has_many through
body: <p>I have three models</p>
  
  <pre class="lang-rb prettyprint-override"><code>class Project &lt; ApplicationRecord
    has_many :project_skills
    has_many :skills, :through =&gt; :project_skills
  end
  
  class Skill &lt; ApplicationRecord
    has_many :project_skills
    has_many :projects, :through =&gt; :project_skills
  end
  
  class ProjectSkill &lt; ApplicationRecord
    belongs_to :skill
    belongs_to :project
  end
  </code></pre>
  
  <p>I want to create a search that finds all the projects that include a set of skills. </p>
  
  <p>For example:</p>
  
  <ul>
  <li>project1 skills: java, ruby, html</li>
  <li>project2 skills: ruby, c++. </li>
  </ul>
  
  <p>So, when I search for "ruby" my result should be project1 and project2.</p>