group.rb 777 B

1234567891011121314151617181920212223242526272829
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class Group < ApplicationModel
  3. include CanBeImported
  4. include HasActivityStreamLog
  5. include ChecksClientNotification
  6. include ChecksHtmlSanitized
  7. include HasHistory
  8. include HasObjectManagerAttributes
  9. include HasCollectionUpdate
  10. include HasSearchIndexBackend
  11. include Group::Assets
  12. belongs_to :email_address, optional: true
  13. belongs_to :signature, optional: true
  14. # workflow checks should run after before_create and before_update callbacks
  15. include ChecksCoreWorkflow
  16. core_workflow_screens 'create', 'edit'
  17. validates :name, presence: true
  18. validates :note, length: { maximum: 250 }
  19. sanitized_html :note, no_images: true
  20. activity_stream_permission 'admin.group'
  21. end