created user model

This commit is contained in:
2024-08-07 16:59:14 +02:00
parent f3b67b0800
commit ffc09cabc4
5 changed files with 23 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
class Article < ApplicationRecord
include Visible
belongs_to: :user
has_many :comments, dependent: :destroy
validates :title, presence: true

View File

@@ -1,3 +1,5 @@
class User < ApplicationRecord
has_many :articles, dependent: :destroy
has_secure_password
end