Class: PactBroker::Api::Contracts::WebhookContract
- Inherits:
-
BaseContract
- Object
- Reform::Form
- BaseContract
- PactBroker::Api::Contracts::WebhookContract
- Defined in:
- lib/pact_broker/api/contracts/webhook_contract.rb
Class Method Summary collapse
-
.errors ⇒ Object
rubocop: disable Lint/NestedMethodDefinition.
Instance Method Summary collapse
Class Method Details
.errors ⇒ Object
rubocop: disable Lint/NestedMethodDefinition
24 |
# File 'lib/pact_broker/api/contracts/webhook_contract.rb', line 24 def self.errors; @first_errors end |
Instance Method Details
#validate ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/pact_broker/api/contracts/webhook_contract.rb', line 12 def validate(*) result = super # I just cannot seem to get the validation to stop on the first error. # If one rule fails, they all come back failed, and it's driving me nuts. # Why on earth would I want that behaviour? # I cannot believe I have to do this shit. @first_errors = errors @first_errors..keys.each do | key | @first_errors.[key] = @first_errors.[key][0...1] end # rubocop: disable Lint/NestedMethodDefinition def self.errors; @first_errors end # rubocop: enable Lint/NestedMethodDefinition result end |