Merge remote-tracking branch 'parent/main' into upstream-20240218

This commit is contained in:
KMY 2024-02-22 07:48:56 +09:00
commit a23f77a5b8
90 changed files with 2926 additions and 2298 deletions

View file

@ -101,6 +101,9 @@ class UserRole < ApplicationRecord
before_validation :set_position
scope :assignable, -> { where.not(id: EVERYONE_ROLE_ID).order(position: :asc) }
scope :highlighted, -> { where(highlighted: true) }
scope :with_color, -> { where.not(color: [nil, '']) }
scope :providing_styles, -> { highlighted.with_color }
has_many :users, inverse_of: :role, foreign_key: 'role_id', dependent: :nullify