I have an array @horses = [] that I fill with some random horses.
@horses = []
How can I check if my @horses array includes a horse that is already incl
@horses
If you want to check if an object is within in array by checking an attribute on the object, you can use any? and pass a block that evaluates to true or false:
unless @suggested_horses.any? {|h| h.id == horse.id } @suggested_horses << horse end