Skip to content
Browse files

hash

  • Loading branch information...
1 parent 2cdd263 commit fb5f0548ea22fef816a13c3cea8f2d2bd63fc837 @yayugu committed
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

0 comments on commit fb5f054

Please sign in to comment.
Something went wrong with that request. Please try again.