include?(record)
Instance Public methods
Returns true
if the given object is present in the collection.
1 2 3 4 5 6 7 8 | class Person < ActiveRecord::Base has_many :pets end person.pets # => [#<Pet id: 20, name: "Snoop">] person.pets.include?(Pet.find( 20 )) # => true person.pets.include?(Pet.find( 21 )) # => false |
Please login to continue.