From 5a0d4192e468661b16e716dfb72fb0fac25a751f Mon Sep 17 00:00:00 2001 From: Pablo Herrero Date: Sat, 31 May 2025 22:25:48 -0300 Subject: [PATCH 1/2] Added missing call to super --- spec/plugins_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/plugins_spec.rb b/spec/plugins_spec.rb index 001de11..667569b 100644 --- a/spec/plugins_spec.rb +++ b/spec/plugins_spec.rb @@ -13,6 +13,7 @@ module ClassMethods attr_accessor :bar def inherited(subclass) + super subclass.bar = bar end end From 1c993bc759815d48c8030f4a5ab3d08db6d12c9f Mon Sep 17 00:00:00 2001 From: Pablo Herrero Date: Sat, 31 May 2025 22:26:28 -0300 Subject: [PATCH 2/2] Removed deprecated :auto_wire_options parameter --- CHANGELOG.md | 4 ++++ lib/pathway/plugins/dry_validation.rb | 13 ++----------- spec/plugins/dry_validation_spec.rb | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 850d008..1c42bcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [1.2.0] - 2025-06-01 +### Changed +- Removed deprecated `:auto_wire_options` option from `:dry_validation` plugin + ## [1.1.0] - 2025-05-30 ### Added - Added `:if` and `:unless` options for `:transaction` and `:after_commit` methods at `:sequel_models` plugin diff --git a/lib/pathway/plugins/dry_validation.rb b/lib/pathway/plugins/dry_validation.rb index ca44cc3..8e73346 100644 --- a/lib/pathway/plugins/dry_validation.rb +++ b/lib/pathway/plugins/dry_validation.rb @@ -9,9 +9,6 @@ module ClassMethods attr_reader :contract_class, :contract_options attr_accessor :auto_wire - alias_method :auto_wire_options, :auto_wire - alias_method :auto_wire_options=, :auto_wire= - def contract(base = nil, &) if block_given? base ||= _base_contract @@ -53,7 +50,7 @@ def _base_contract module InstanceMethods extend Forwardable - delegate %i[build_contract contract_options auto_wire_options auto_wire] => 'self.class' + delegate %i[build_contract contract_options auto_wire] => 'self.class' alias_method :contract, :build_contract def validate(state, with: nil) @@ -72,13 +69,7 @@ def validate_with(input, **) end end - def self.apply(operation, auto_wire_options: (auto_wire_options_was_not_used=true; false), auto_wire: auto_wire_options) - #:nocov: - unless auto_wire_options_was_not_used - warn "[DEPRECATION] `auto_wire_options` is deprecated. Please use `auto_wire` instead" - end - #:nocov: - + def self.apply(operation, auto_wire: false) operation.auto_wire = auto_wire operation.contract_class = Dry::Validation::Contract end diff --git a/spec/plugins/dry_validation_spec.rb b/spec/plugins/dry_validation_spec.rb index e2b659b..43c4fd5 100644 --- a/spec/plugins/dry_validation_spec.rb +++ b/spec/plugins/dry_validation_spec.rb @@ -231,7 +231,7 @@ class OperationWithAutoWire < Operation expect(operation.call(qux: 'OTHER')).to be_a_failure end - context "and is using auto_wire_options" do + context "and is using auto_wire: true" do subject(:operation) { OperationWithAutoWire.new(baz: 'XXXXX') } it "sets the options directly from the context using the keys with the same name" do