serradura/backend-code-challenge

View on GitHub
app/models/distribution_point.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

class DistributionPoint < ApplicationRecord
  include DistributionPoints::WithParamsSchemaValidation

  scope :by_origin_and_destination, ->(conditions) do
    where Types::FilledHash[conditions].slice(:origin, :destination)
  end
end