These are chat archives for dry-rb/chat
Next-gen ruby libs! » github.com/dry-rb » website: https://dry-rb.org » forum: https://discourse.dry-rb.org
Hello, folks. Cold you explain to me, how to use container? I have a gem which may be configured with
custom class implementations, but defaults implementation is also provided. For examle:
Subscriptions.dependencies[:CancellationManager] = Subscriptions::DefaultCancellationManager.new
I want to replace my DI implementation with
dry-cantainer, but could not figure out that is the
right way to register default dependency value in a gem, and provide ability to override it in an app?
Container#importmethod and IIRC will override exisiting stuff /cc @AMHOL
#importwill do that, just does a
Hash#mergeon the container
Hi, guys! I try to migrate from reform 2.1 to 2.2 and to dry-validation, but get this error:
ArgumentError: +validates+ is not a valid predicate name
from /Users/semenovDL/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/dry-validation-0.9.3/lib/dry/validation/predicate_registry.rb:98:in `raise_unknown_predicate_error'
# Gemfile gem 'rails', '~> 4.2.3' # ... gem 'dry-validation', '~> 0.9.3' gem 'reform', '~> 2.2', '>= 2.2.1' # config/initializers/dry_types.rb module Types include Dry::Types.module end # config/initializers/reform.rb require 'reform/form/dry' Reform::Form.class_eval do include Reform::Form::Dry end # app/forms/basic_form.rb class BasicForm < Reform::Form property :name validates :name, presence: true end
Form have Reform::Form::Dry::Validations in ancestors. So the block record in Heritage.
What happend then?
Can you help me with it?