scambra/devise_invitable — Issue #176: Permitting non-users to send invitations, but retaining invited_by functionality
Author: daidekman
Created: 2012-02-23 13:45:54+00:00
State: open

Thanks for an outstanding addition to Devise -- this is extremely helpful. I am struggling to adjust one element of the function and seek your help.

I want to keep the exact same functionality of invitable: users inviting others to the site, who then register with the invited_by_id recorded.

However, I would also like non-users (not logged in) to be able to send invitations. In this case, user would still require an invitation to register, they would continue with password confirmation and everything the same, except that the invited_by_id would be nil or blank.

It appears to me that I need to put "authenticate_inviter!" in the ApplicationController to overwrite the default code. I have been able to do this -- leaving the method blank -- to allow non-users to send invitations. But I am unable to determine where the code is to record invited_by_id when there is a current user logged in.

Many thanks for help on this!
-Dave