residency/app/models/story.rb

14 lines
285 B
Ruby

class Story < ApplicationRecord
belongs_to :member
mount_uploader :picture, PictureUploader
validates :text, length: { minimum: 5 , maximum: 1000 }
validates :header , length: { minimum: 5 , maximum: 400}
validates :picture, presence: true
def name
header
end
end