Show unused invitations list
This commit is contained in:
@@ -2,10 +2,13 @@ class Invitation < ApplicationRecord
|
||||
# Relations
|
||||
belongs_to :user
|
||||
|
||||
# Validations
|
||||
validates_presence_of :user
|
||||
|
||||
# Hooks
|
||||
before_create :generate_token
|
||||
|
||||
# Scopes
|
||||
scope :unused, -> { where(used_at: nil) }
|
||||
scope :used, -> { where.not(used_at: nil) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user