Skip to content

Instantly share code, notes, and snippets.

@chap
Created June 10, 2011 21:58
Show Gist options
  • Select an option

  • Save chap/1019864 to your computer and use it in GitHub Desktop.

Select an option

Save chap/1019864 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
def find_matches
User.where(:mentor_or_mentee => self.looking_for)
end
def looking_for
self.mentor_or_mentee == 1 ? 2 : 1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment