Sha256: a8f54ec7d58659065d51fbc87fa8e3459ab381928fc3ee3fbf81e3eeb34950cc

Contents?: true

Size: 450 Bytes

Versions: 16

Compression:

Stored size: 450 Bytes

Contents

module NulogyMessageBusProducer
  module Subscriptions
    class ValidForSchemaValidator < ActiveModel::EachValidator
      def validate_each(record, attribute, _value)
        return if record.schema_key.blank? || record.query.blank?

        validator = NulogyMessageBusProducer::Subscriptions::QueryValidator.new

        validator.validate(record)
        validator.errors.each { |e| record.errors.add(attribute, e) }
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
nulogy_message_bus_producer-5.0.8 lib/nulogy_message_bus_producer/subscriptions/valid_for_schema_validator.rb
nulogy_message_bus_producer-5.0.7 lib/nulogy_message_bus_producer/subscriptions/valid_for_schema_validator.rb
nulogy_message_bus_producer-5.0.6 lib/nulogy_message_bus_producer/subscriptions/valid_for_schema_validator.rb
nulogy_message_bus_producer-5.0.5 lib/nulogy_message_bus_producer/subscriptions/valid_for_schema_validator.rb
nulogy_message_bus_producer-5.0.4 lib/nulogy_message_bus_producer/subscriptions/valid_for_schema_validator.rb
nulogy_message_bus_producer-5.0.3 lib/nulogy_message_bus_producer/subscriptions/valid_for_schema_validator.rb
nulogy_message_bus_producer-5.0.2 lib/nulogy_message_bus_producer/subscriptions/valid_for_schema_validator.rb
nulogy_message_bus_producer-5.0.1 lib/nulogy_message_bus_producer/subscriptions/valid_for_schema_validator.rb
nulogy_message_bus_producer-5.0.1.alpha lib/nulogy_message_bus_producer/subscriptions/valid_for_schema_validator.rb
nulogy_message_bus_producer-5.0.0 lib/nulogy_message_bus_producer/subscriptions/valid_for_schema_validator.rb
nulogy_message_bus_producer-4.0.0 lib/nulogy_message_bus_producer/subscriptions/valid_for_schema_validator.rb
nulogy_message_bus_producer-3.7.0 lib/nulogy_message_bus_producer/subscriptions/valid_for_schema_validator.rb
nulogy_message_bus_producer-3.6.0 lib/nulogy_message_bus_producer/subscriptions/valid_for_schema_validator.rb
nulogy_message_bus_producer-3.5.0 lib/nulogy_message_bus_producer/subscriptions/valid_for_schema_validator.rb
nulogy_message_bus_producer-4.0.0.alpha lib/nulogy_message_bus_producer/subscriptions/valid_for_schema_validator.rb
nulogy_message_bus_producer-3.4.1 lib/nulogy_message_bus_producer/subscriptions/valid_for_schema_validator.rb