Add basic invitations

This commit is contained in:
2020-12-02 15:22:58 +01:00
parent 18df8fe449
commit d7fbda0855
12 changed files with 152 additions and 4 deletions

14
app/models/invitation.rb Normal file
View File

@@ -0,0 +1,14 @@
class Invitation < ApplicationRecord
# Relations
belongs_to :user
validates_presence_of :user
before_create :generate_token
private
def generate_token
self.token = SecureRandom.hex(8)
end
end