devise_invitable icon indicating copy to clipboard operation
devise_invitable copied to clipboard

`before_invitation_created` callback executed for `User.invite!`, but not for `@user.invite!`

Open Aerlinger opened this issue 8 years ago • 1 comments

See title.

I'd expect for this callback to be executed for both method calls, but clearly this isn't the case. Is this a bug or desired behavior? If it's expected behavior it might be worth specifying this quirk in the docs. Either way, happy to lend a hand with a PR.

I'm using devise_invitable from master if that's useful information at all.

Aerlinger avatar Apr 06 '16 02:04 Aerlinger

It isn't expected behaviour, indeed run_callbacks :invitation_created it's called inside @user.invite! method, I don't know why it wasn't called for you. What version are you using? I don't remember if previous versions was different, I only checked current code.

scambra avatar Apr 06 '16 07:04 scambra