Skip to content

Instantly share code, notes, and snippets.

@apneadiving
Last active November 28, 2016 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apneadiving/74d95a14a9485ee394179a69c2e6517c to your computer and use it in GitHub Desktop.
Save apneadiving/74d95a14a9485ee394179a69c2e6517c to your computer and use it in GitHub Desktop.
def accept_invitation
Wf.new
.chain(user: :user) { AcceptInvitation.new(invitation).call }
.chain {|outflow| render json: { user: outflow.user } }
.on_dam do |error_pool|
render json: { errors: error_pool.full_messages }, status: 422
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment