Untitled

 avatar
unknown
ruby
5 months ago
408 B
4
Indexable
# frozen_string_literal: true

class Inputs < Dry::Validation::Contract

  config.validate_keys = false

  config.messages.backend = :yaml
  config.messages.load_paths << Rails.root.join('config', 'locales', 'inputs.yml')

  option :params

  def call
    super(params).tap do |result|
      self.attributes = result.values
    end
  end

  attr_reader :attributes

  private

  attr_writer :attributes

end
Editor is loading...
Leave a Comment