has_object_manager_attributes.rb 427 B

1234567891011121314
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module HasObjectManagerAttributes
  3. extend ActiveSupport::Concern
  4. included do
  5. # Disable table inheritance to allow columns with the name 'type'.
  6. self.inheritance_column = nil
  7. validates_with Validations::ObjectManager::AttributeValidator, on: %i[create update]
  8. after_initialize ObjectManager::Attribute::SetDefaults.new
  9. end
  10. end