Skip to content

Instantly share code, notes, and snippets.

@mallain
Created May 26, 2010 12:24
Show Gist options
  • Save mallain/414409 to your computer and use it in GitHub Desktop.
Save mallain/414409 to your computer and use it in GitHub Desktop.
class HrArrivalCollaborator < ActiveRecord::Base
belongs_to :feedback
belongs_to :agency
belongs_to :function
validates_presence_of :feedback, :agency, :function, :lastname, :firstname, :lastname, :email
validates_uniqueness_of :email
def validate
errors.add("email", "has already been token") if Collaborator.all.map(&:email).include?(self.email)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment