Add scopes for invitations
This commit is contained in:
@@ -6,6 +6,9 @@ class Invitation < ApplicationRecord
|
||||
|
||||
before_create :generate_token
|
||||
|
||||
scope :unused, -> { where(used_at: nil) }
|
||||
scope :used, -> { where.not(used_at: nil) }
|
||||
|
||||
private
|
||||
|
||||
def generate_token
|
||||
|
||||
Reference in New Issue
Block a user