base.rb 380 B

1234567891011121314151617181920
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Setting::Validation::Base
  3. attr_reader :record, :value
  4. def initialize(record)
  5. @record = record
  6. @value = record.state_current.fetch('value', {})
  7. end
  8. private
  9. def result_success
  10. { success: true }
  11. end
  12. def result_failed(msg)
  13. { success: false, message: msg }
  14. end
  15. end