add max length for profile and event

This commit is contained in:
Torsten 2023-09-06 12:51:16 +03:00
parent 358e95f701
commit 2c399fbe18
3 changed files with 5 additions and 5 deletions

View File

@ -1,8 +1,8 @@
class Event < ApplicationRecord
belongs_to :profile
validates :name , presence: true
validates :text , presence: true
validates_length_of :name , minimum: 3 , maximum: 100
validates_length_of :text, minimum: 30 , maximum: 1200
validates :start_date , presence: true
validates :picture , presence: true

View File

@ -2,9 +2,9 @@ class Profile < ApplicationRecord
belongs_to :member
has_many :events
validates :name , presence: true
validates_length_of :name , minimum: 3 , maximum: 100
validates_length_of :bio , minimum: 30 , maximum: 600
validates :kind , presence: true
validates :bio , presence: true
validates :picture , presence: true
mount_uploader :picture, PictureUploader

View File

@ -12,4 +12,4 @@
%h5.m-4.text-3xl.font-bold.text-center
= profile.name
.mb-8.text-gray-800.text-center
.prose= markdown(profile.bio)
.prose= markdown(shorten(profile.bio))