Skip to content

Commit

Permalink
Follow up 58da12c - Feature: Desktop view - Implement Token Access pe…
Browse files Browse the repository at this point in the history
…rsonal setting section.
  • Loading branch information
mantas committed May 14, 2024
1 parent 911dc0c commit 60f0059
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/models/permission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ class Permission < ApplicationModel
store :preferences

validates :name, presence: true
validates :label, length: { maximum: 255 }
validates :description, length: { maximum: 500 }

# This is added to handle migrations from before the columns were modified.
# For example when upgrading from pre-6.4.
# Otherwise older migrations fail since those columnsa are not yet available.
with_options if: -> { respond_to?(:label) && respond_to?(:description) } do
validates :label, length: { maximum: 255 }
validates :description, length: { maximum: 500 }
end

sanitized_html :description

Expand Down

0 comments on commit 60f0059

Please sign in to comment.