feat: Portal endpoint (#4633)

This commit is contained in:
Tejaswini Chile
2022-05-16 13:59:59 +05:30
committed by GitHub
parent 6535624cd6
commit 938fb887c4
39 changed files with 198 additions and 132 deletions

20
app/models/folder.rb Normal file
View File

@@ -0,0 +1,20 @@
# == Schema Information
#
# Table name: folders
#
# id :bigint not null, primary key
# name :string
# created_at :datetime not null
# updated_at :datetime not null
# account_id :integer not null
# category_id :integer not null
#
class Folder < ApplicationRecord
belongs_to :account
belongs_to :category
has_many :articles, dependent: :nullify
validates :account_id, presence: true
validates :category_id, presence: true
validates :name, presence: true
end