Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

hash

  • Loading branch information...
commit fb5f0548ea22fef816a13c3cea8f2d2bd63fc837 1 parent 2cdd263
@yayugu authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 app/models/user.rb
View
5 app/models/user.rb
@@ -1,2 +1,7 @@
+require 'digest/sha1'
+
class User < ActiveRecord::Base
+ before_create do
+ self.url_id_hash = Digest::SHA1.hexdigest(rand().to_s + self.twitter_id)
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.