Sha256: 4b67d3732405685a296f25cb4a344178aeb92f456227f0d4ef855b6117f8a1ae
Contents?: true
Size: 882 Bytes
Versions: 9
Compression:
Stored size: 882 Bytes
Contents
# frozen_string_literal: true class Serega module SeregaPlugins module ExplicitManyOption # # Validator for attribute :many option # class CheckOptMany class << self # # Checks attribute :many option must be provided with relations # # @param opts [Hash] Attribute options # # @raise [SeregaError] Attribute validation error # # @return [void] # def call(opts) serializer = opts[:serializer] return unless serializer many_option_exists = opts.key?(:many) return if many_option_exists raise SeregaError, "Attribute option :many [Boolean] must be provided" \ " for attributes with :serializer option" end end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems