Skip to content

Instantly share code, notes, and snippets.

@stevegraham
Created November 8, 2010 16:37
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 stevegraham/667896 to your computer and use it in GitHub Desktop.
Save stevegraham/667896 to your computer and use it in GitHub Desktop.
while self[:slug].nil? && Referral.exists? :slug => self[:slug]
self[:slug] = ActiveSupport::SecureRandom.hex 6
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment