{"action":"created","issue":{"url":"https://api.github.com/repos/AaronLasseigne/active_interaction/issues/437","repository_url":"https://api.github.com/repos/AaronLasseigne/active_interaction","labels_url":"https://api.github.com/repos/AaronLasseigne/active_interaction/issues/437/labels{/name}","comments_url":"https://api.github.com/repos/AaronLasseigne/active_interaction/issues/437/comments","events_url":"https://api.github.com/repos/AaronLasseigne/active_interaction/issues/437/events","html_url":"https://github.com/AaronLasseigne/active_interaction/issues/437","id":316030776,"node_id":"MDU6SXNzdWUzMTYwMzA3NzY=","number":437,"title":"Validate method with errors.add causing multiple validation calls...","user":{"login":"hurrycaner","id":2671143,"node_id":"MDQ6VXNlcjI2NzExNDM=","avatar_url":"https://avatars0.githubusercontent.com/u/2671143?v=4","gravatar_id":"","url":"https://api.github.com/users/hurrycaner","html_url":"https://github.com/hurrycaner","followers_url":"https://api.github.com/users/hurrycaner/followers","following_url":"https://api.github.com/users/hurrycaner/following{/other_user}","gists_url":"https://api.github.com/users/hurrycaner/gists{/gist_id}","starred_url":"https://api.github.com/users/hurrycaner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hurrycaner/subscriptions","organizations_url":"https://api.github.com/users/hurrycaner/orgs","repos_url":"https://api.github.com/users/hurrycaner/repos","events_url":"https://api.github.com/users/hurrycaner/events{/privacy}","received_events_url":"https://api.github.com/users/hurrycaner/received_events","type":"User","site_admin":false},"labels":[{"id":45221847,"node_id":"MDU6TGFiZWw0NTIyMTg0Nw==","url":"https://api.github.com/repos/AaronLasseigne/active_interaction/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-04-19T20:34:58Z","updated_at":"2018-08-17T13:47:07Z","closed_at":null,"author_association":"NONE","body":"So, i made this class with a `validate :field_exists?` method returning an `errors.add(:base, 'message')`:\r\n```ruby\r\n# frozen_string_literal: true\r\nclass TestValidate < ActiveInteraction::Base\r\n  set_callback :type_check, :around, lambda { |_interaction, block|\r\n    puts '>>> type_check >>>'\r\n    block.call\r\n    puts '<<< type_check <<<'\r\n  }\r\n  set_callback :validate, :around, lambda { |_interaction, block|\r\n    puts '>>> validate >>>'\r\n    block.call\r\n    puts '<<< validate <<<'\r\n  }\r\n  set_callback :execute, :around, lambda { |_interaction, block|\r\n    puts '>>> execute >>>'\r\n    block.call\r\n    puts '<<< execute <<<'\r\n  }\r\n\r\n  string :field, default: nil\r\n  validate :field_exists?, if: :field?\r\n\r\n  def execute\r\n    puts '...executing'\r\n  end\r\n\r\n  private\r\n\r\n  def field_exists?\r\n    puts '...validating field_exists?'\r\n    errors.add(:field, 'error message')\r\n    puts '...validated field_exists?'\r\n  end\r\nend\r\n```\r\n\r\nWhen i run it i'm getting duplicate validations:\r\n```\r\n>>> type_check >>>\r\n<<< type_check <<<\r\n>>> validate >>>\r\n...validating field_exists?\r\n...validated field_exists?\r\n<<< validate <<<\r\n>>> type_check >>>\r\n<<< type_check <<<\r\n>>> validate >>>\r\n...validating field_exists?\r\n...validated field_exists?\r\n<<< validate <<<\r\n```\r\n\r\nWhen i run it without the `errors.add` it work as expected:\r\n```\r\n>>> type_check >>>\r\n<<< type_check <<<\r\n>>> validate >>>\r\n...validating field_exists?\r\n...validated field_exists?\r\n<<< validate <<<\r\n>>> execute >>>\r\n...executing\r\n<<< execute <<<\r\n```"},"comment":{"url":"https://api.github.com/repos/AaronLasseigne/active_interaction/issues/comments/413871301","html_url":"https://github.com/AaronLasseigne/active_interaction/issues/437#issuecomment-413871301","issue_url":"https://api.github.com/repos/AaronLasseigne/active_interaction/issues/437","id":413871301,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzg3MTMwMQ==","user":{"login":"hurrycaner","id":2671143,"node_id":"MDQ6VXNlcjI2NzExNDM=","avatar_url":"https://avatars0.githubusercontent.com/u/2671143?v=4","gravatar_id":"","url":"https://api.github.com/users/hurrycaner","html_url":"https://github.com/hurrycaner","followers_url":"https://api.github.com/users/hurrycaner/followers","following_url":"https://api.github.com/users/hurrycaner/following{/other_user}","gists_url":"https://api.github.com/users/hurrycaner/gists{/gist_id}","starred_url":"https://api.github.com/users/hurrycaner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hurrycaner/subscriptions","organizations_url":"https://api.github.com/users/hurrycaner/orgs","repos_url":"https://api.github.com/users/hurrycaner/repos","events_url":"https://api.github.com/users/hurrycaner/events{/privacy}","received_events_url":"https://api.github.com/users/hurrycaner/received_events","type":"User","site_admin":false},"created_at":"2018-08-17T13:47:07Z","updated_at":"2018-08-17T13:47:07Z","author_association":"NONE","body":"@AaronLasseigne can you share it?"}}
{"actor":{"display_login":"hurrycaner"}}