Checking for an object in a collection


#1

Is there a quick way to to check for an object’s existence in a
collection?


#2

Pieter M. wrote:

Is there a quick way to to check for an object’s existence in a
collection?

collection.include?(object) or collection.find(object) depending on what
collection you have, I guess.


Jakob S. - http://mentalized.net


#3

Jakob S. wrote:

Pieter M. wrote:

Is there a quick way to to check for an object’s existence in a
collection?

collection.include?(object) or collection.find(object) depending on what
collection you have, I guess.


Jakob S. - http://mentalized.net

Thanks!


#4

correction, find on a collection works only for id.