group.rb 817 B

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