Array.select in ruby : I'm trying to get result array if the `data` array has matching with respect to `compare_data` array. So below is the code, however the return array has complete values from original array i.e `data`. 

Reference Data:

    data = [
      {
        "id": 100,
        "name": "Rob",
        "age": "22",
        "job": "Tester"
      },
      {
        "id": 101,
        "name": "Matt",
        "age": "28",
        "job": "Engineer"
      }
    ]

Comparing Data:

    compare_data = [{"age": "21"},{"age": "29"},{"age": "22"} ]

Code Block:

    new_array = data.select do |each_item| 
      compare_data.map do |child| 
        child[:age].include?(each_item[:age])
      end
    end
    puts new_array #{:id=>100, :name=>"Rob", :age=>"22", :job=>"Tester"}{:id=>101, :name=>"Matt", :age=>"28", :job=>"Engineer"}