app/models/person.rb
#whether this person belongs to a project in common with the other item - whcih can eb a person, project or enumeration of projects
whether this person belongs to a project in common with the other item - whcih can eb a person, project or enumeration of projects
whether this person belongs to a project in common with the other item - whcih can eb a person project or enumeration of projects
def shares_project? other_item
    if other_item.is_a?(Project) || other_item.is_a?(Enumerable)
      projects = Array(other_item)
    else
      projects = other_item.projects
    end
    (self.projects & projects).any?
  end
def shares_project? other_item if other_item . is_a? ( Project ) || other_item . is_a? ( Enumerable ) projects = Array ( other_item ) else projects = other_item . projects end ( self . projects & projects ) . any? end
whether this person belongs to a project in common with the other item - whcih can eb a person, project or enumeration of projects
whether this person belongs to a project in common with the other item - whcih can eb a person project or enumeration of projects
other_item