Sha256: 7cd89cd5b38d31b61614043c2221a38a022bb17d901d8d2512f7dc13ff372783

Contents?: true

Size: 493 Bytes

Versions: 43

Compression:

Stored size: 493 Bytes

Contents

module ForestAdminDatasourceToolkit
  module Validations
    class SortValidator
      def self.validate(collection, sort)
        sort&.each do |s|
          FieldValidator.validate(collection, s[:field])
          unless s[:ascending].is_a?(TrueClass) || s[:ascending].is_a?(FalseClass)
            raise ForestAdminDatasourceToolkit::Exceptions::ValidationError,
                  "Invalid sort_utils.ascending value: #{s[:ascending]}"
          end
        end
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
forest_admin_datasource_toolkit-1.0.0.pre.beta.81 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.80 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.79 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.78 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.77 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.76 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.75 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.74 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.73 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.72 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.71 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.70 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.69 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.68 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.67 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.66 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.65 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.64 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.63 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb
forest_admin_datasource_toolkit-1.0.0.pre.beta.62 lib/forest_admin_datasource_toolkit/validations/sort_validator.rb