title: How to search for a record correctly?
body: <p>I'm new to Rails &amp; ActiveRecord and am working on my first CLI app. I want to allow a user to be able to retrieve information based on their target input. For example, if they want a list of happy people, they should get a list of ALL happy people. </p>
  
  <p>I have come up with this code, it works but not really.</p>
  
  <p><code>types_list = People.where(types: input).map {|ppl| ppl.person_name}</code></p>
  
  <p>Some of the information is is stored like this:</p>
  
  <pre><code>id  | person_name  | types
  ----------------------------------
  01  | James Lee    | happy
  02  | Sandra Lee   | sad
  03  | Daniel Seong | happy, sad
  04  | Cody Kim     | happy
  05  | etc...       | 
  </code></pre>
  
  <p>The above code only returns "James Lee, Cody Kim". However, I also want it to include "Daniel Seong". Basically all <code>person_name:</code> where the <code>types:</code> includes happy.</p>