rails-refresher/app/models/article.rb

9 lines
194 B
Ruby
Raw Normal View History

2024-07-05 01:00:08 +00:00
class Article < ApplicationRecord
include Visible
has_many :comments, dependent: :destroy
validates :title, presence: true
validates :body, presence: true, length: { minimum: 10 }
end