13 lines
391 B
Ruby
13 lines
391 B
Ruby
class Post < ApplicationRecord
|
|
belongs_to :blog
|
|
has_one_attached :icon_image
|
|
has_many :comments
|
|
has_rich_text :text
|
|
has_rich_text :mood
|
|
has_rich_text :music
|
|
validates :post_title, presence: true,
|
|
length: { minimum: 5 }
|
|
validates :text, presence: true,
|
|
length: { minimum: 5 }
|
|
validates :icon_image, presence:true
|
|
end
|