feat: CRUD operation for associated articles to current article (#4912)

This commit is contained in:
Tejaswini Chile
2022-07-04 20:29:44 +05:30
committed by GitHub
parent 62ed9fe1b4
commit ae59d0a343
28 changed files with 422 additions and 33 deletions

View File

@@ -89,10 +89,17 @@ class User < ApplicationRecord
has_many :notification_settings, dependent: :destroy_async
has_many :notification_subscriptions, dependent: :destroy_async
has_many :notifications, dependent: :destroy_async
has_many :portals, through: :portals_members
has_many :team_members, dependent: :destroy_async
has_many :teams, through: :team_members
has_many :articles, foreign_key: 'author_id', dependent: :nullify
has_many :portal_members,
class_name: :PortalMember,
dependent: :destroy_async
has_many :portals,
through: :portals_members,
class_name: :Portal,
dependent: :nullify,
source: :portal
before_validation :set_password_and_uid, on: :create