14 lines
379 B
Ruby
14 lines
379 B
Ruby
|
|
class Post < ApplicationRecord
|
||
|
|
belongs_to :blog
|
||
|
|
has_one_attached :icon_image
|
||
|
|
#has_many :comments
|
||
|
|
has_rich_text :body
|
||
|
|
has_rich_text :mood
|
||
|
|
has_rich_text :music
|
||
|
|
validates :title, presence: true,
|
||
|
|
length: { minimum: 2 }
|
||
|
|
validates :body, presence: true,
|
||
|
|
length: { minimum: 5 }
|
||
|
|
# validates :icon_image, presence:true
|
||
|
|
end
|