residency/app/models/story.rb

14 lines
285 B
Ruby
Raw Normal View History

2023-01-11 17:48:06 +01:00
class Story < ApplicationRecord
2023-01-11 19:52:58 +01:00
belongs_to :member
mount_uploader :picture, PictureUploader
2023-01-22 19:29:10 +01:00
validates :text, length: { minimum: 5 , maximum: 1000 }
validates :header , length: { minimum: 5 , maximum: 400}
2023-06-18 15:21:41 +02:00
validates :picture, presence: true
2023-01-12 13:34:26 +01:00
2023-01-11 19:52:58 +01:00
def name
header
end
2023-01-11 17:48:06 +01:00
end