story editor polish

This commit is contained in:
2023-01-22 20:29:10 +02:00
parent 0ac1c341df
commit f6bac88800
8 changed files with 40 additions and 53 deletions

View File

@ -7,6 +7,9 @@ class Member < ApplicationRecord
mount_uploader :picture, PictureUploader
has_many :stories
validates :bio, length: { maximum: 1000 }
validates :name , length: { minimum: 3 }
def admin
self.email == "torsten@villataika.fi"
end

View File

@ -3,8 +3,8 @@ class Story < ApplicationRecord
mount_uploader :picture, PictureUploader
validates :text, length: { maximum: 1000 }
validates :header , length: { minimum: 5 }
validates :text, length: { minimum: 5 , maximum: 1000 }
validates :header , length: { minimum: 5 , maximum: 400}
def name
header