Skip to content

Instantly share code, notes, and snippets.

@erichurst
Created May 1, 2010 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erichurst/386703 to your computer and use it in GitHub Desktop.
Save erichurst/386703 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
...
def self.find_valid_referral(username)
user = User.find_by_username(username)
if user.nil?
nil
else
user.id
end
end
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment