0
0
Fork 0

Add explicit dependent: nil to associations (#28169)

This commit is contained in:
Matt Jankowski 2023-12-01 10:52:47 -05:00 committed by GitHub
parent 1564799952
commit f70f39dd04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 20 additions and 30 deletions

View file

@ -20,7 +20,7 @@ class Invite < ApplicationRecord
include Expireable
belongs_to :user, inverse_of: :invites
has_many :users, inverse_of: :invite
has_many :users, inverse_of: :invite, dependent: nil
scope :available, -> { where(expires_at: nil).or(where('expires_at >= ?', Time.now.utc)) }