I have an array of hashes like this:
array = [{ "id"=>"ABC", "account"=>"XYZ", "date"=>"2014-07-21", "amount"=>200, "score"=>{"location"=>{"city"=>1, "state"=>1}, "name"=>1}, "cat"=>#<Tipper::Category:0xb666fb0 @type={"primary"=>"special"}, @hierarchy=["Transfer","Withdrawal", "ATM"], @id="21012002" >, "state"=>"CA" }, {"id=>"XYZ","account"=>"987"}] I want to iterate through each hash in the array and remove the "category" piece from each hash and produce an array of hashes without the "category" item in any of the hashes. I tried this:
filtered_array = array.reject { |t| array.include? t['cat'] } This is not doing it.
array, but the code snippet never referencesarray