2024-08-07 14:43:33 +00:00
|
|
|
class Article < ApplicationRecord
|
|
|
|
include Visible
|
|
|
|
|
2024-08-08 09:19:44 +00:00
|
|
|
belongs_to :user
|
2024-08-07 14:43:33 +00:00
|
|
|
has_many :comments, dependent: :destroy
|
|
|
|
|
|
|
|
validates :title, presence: true
|
|
|
|
validates :body, presence: true, length: {minimum: 10}
|
|
|
|
end
|