mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 11:17:49 +01:00
Destroy related post status changes when destroying a post status (#260)
This commit is contained in:
committed by
GitHub
parent
2c4a531933
commit
4e006f69d0
@@ -3,6 +3,7 @@ class PostStatus < ApplicationRecord
|
|||||||
include Orderable
|
include Orderable
|
||||||
|
|
||||||
has_many :posts, dependent: :nullify
|
has_many :posts, dependent: :nullify
|
||||||
|
has_many :post_status_changes, dependent: :destroy
|
||||||
|
|
||||||
validates :name, presence: true, uniqueness: { scope: :tenant_id }
|
validates :name, presence: true, uniqueness: { scope: :tenant_id }
|
||||||
validates :color, format: { with: /\A#(?:[0-9a-fA-F]{3}){1,2}\z/ }
|
validates :color, format: { with: /\A#(?:[0-9a-fA-F]{3}){1,2}\z/ }
|
||||||
|
|||||||
Reference in New Issue
Block a user