Sha256: 551104db6eeebeb2846458874c9237572a7add5ef05c67a6a1c54a9929ffdea0

Contents?: true

Size: 583 Bytes

Versions: 14

Compression:

Stored size: 583 Bytes

Contents

# frozen_string_literal: true

module LittleWeasel
  module Modules
    # This module provides validations related to dictionaries in
    # the dictionary cache.
    module DictionaryValidatable
      module_function

      def validate_dictionary_source_does_not_exist(dictionary_cache_service:)
        # If a dictionary_reference exists, the dictionary_source must exist.
        if dictionary_cache_service.dictionary_reference?
          raise "The dictionary source associated with key '#{dictionary_cache_service.key}' already exists."
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
LittleWeasel-5.0.13 lib/LittleWeasel/modules/dictionary_validatable.rb
LittleWeasel-5.0.12 lib/LittleWeasel/modules/dictionary_validatable.rb
LittleWeasel-5.0.11 lib/LittleWeasel/modules/dictionary_validatable.rb
LittleWeasel-5.0.10 lib/LittleWeasel/modules/dictionary_validatable.rb
LittleWeasel-5.0.9 lib/LittleWeasel/modules/dictionary_validatable.rb
LittleWeasel-5.0.8 lib/LittleWeasel/modules/dictionary_validatable.rb
LittleWeasel-5.0.7 lib/LittleWeasel/modules/dictionary_validatable.rb
LittleWeasel-5.0.6 lib/LittleWeasel/modules/dictionary_validatable.rb
LittleWeasel-5.0.5 lib/LittleWeasel/modules/dictionary_validatable.rb
LittleWeasel-5.0.4 lib/LittleWeasel/modules/dictionary_validatable.rb
LittleWeasel-5.0.3 lib/LittleWeasel/modules/dictionary_validatable.rb
LittleWeasel-5.0.2 lib/LittleWeasel/modules/dictionary_validatable.rb
LittleWeasel-5.0.1 lib/LittleWeasel/modules/dictionary_validatable.rb
LittleWeasel-5.0.0 lib/LittleWeasel/modules/dictionary_validatable.rb