Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 2 additions & 11 deletions lib/pathway/plugins/dry_validation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/plugins/dry_validation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/plugins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module ClassMethods
attr_accessor :bar

def inherited(subclass)
super
subclass.bar = bar
end
end
Expand Down