Class: CanvasSync::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/canvas_sync/engine.rb

Constant Summary collapse

RETENTION_TYPE =
{
  type: 'string',
  validate: ->(value, *args, errors:, **kwargs) {
    origExc = ChronicDuration.raise_exceptions
    ChronicDuration.raise_exceptions = true
    begin
      ChronicDuration.parse(value) unless value == nil
      nil
    rescue ChronicDuration.DurationParseError
      errors << "<path> must be nil or a parseable duration"
    ensure
      ChronicDuration.raise_exceptions = origExc
    end
  }
}