diff options
Diffstat (limited to 'users/app/models')
-rw-r--r-- | users/app/models/token.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/users/app/models/token.rb b/users/app/models/token.rb new file mode 100644 index 0000000..44a6dfe --- /dev/null +++ b/users/app/models/token.rb @@ -0,0 +1,17 @@ +class Token < CouchRest::Model::Base + + use_database :tokens + + property :user_id, String, accessible: false + + validates :user_id, presence: true + + def initialize(*args) + super + self.id = SecureRandom.urlsafe_base64(32) + end + + design do + end +end + |