Skip to content

Is there a way to call the same logic for multiple hooks? #212

Answered by janko
mdodell asked this question in Q&A
Discussion options

You must be logged in to vote

I see what you mean now. No, there isn't any built-in way to chain multiple callbacks, the only option is using a loop:

%i[after_login after_create_account].each do |hook|
  public_send(hook) { merge_account }
end

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mdodell
Comment options

@janko
Comment options

Answer selected by mdodell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants