Skip to content

Commit

Permalink
Userモデルの access_grants と access_tokens 関連に inverse_of オプション追加(Rubocop…
Browse files Browse the repository at this point in the history
…の Rails/InverseOf 指摘を解消)
  • Loading branch information
MikotoMakizuru committed Dec 22, 2024
1 parent 8662f48 commit c732675
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,13 @@ class User < ApplicationRecord
has_many :access_grants,
class_name: 'Doorkeeper::AccessGrant',
foreign_key: :resource_owner_id,
inverse_of: 'resource_owner',
dependent: :delete_all

has_many :access_tokens,
class_name: 'Doorkeeper::AccessToken',
foreign_key: :resource_owner_id,
inverse_of: 'resource_owner',
dependent: :delete_all

has_one_attached :avatar
Expand Down

0 comments on commit c732675

Please sign in to comment.