Skip to content

Commit

Permalink
Validate scenario tag version description size
Browse files Browse the repository at this point in the history
  • Loading branch information
noracato committed May 8, 2024
1 parent 57463a4 commit 09fb47c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/scenario_version_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
# Optional to add version tags to scenarios to display in saved scenario
class ScenarioVersionTag < ApplicationRecord
# scenario the scenario for the tag, cannot be updated
# user the user that created the tag
# text
# user the user that created the tag, or last updated the scenario
# description

belongs_to :scenario
belongs_to :user

validate :validate_user_in_scenario_users
validates :description, length: { maximum: 60_000 }

def as_json(*)
super(except: %i[id scenario_id])
Expand Down

0 comments on commit 09fb47c

Please sign in to comment.