π I did it with DeviseInvitable
gem 'devise_invitable'
π¦ There is a great hook!!
π How to use it?
- I give a block to the super.
-
super do
is the same assuper(attributes, invited_by) do
.
-
- Then, the block will be evaluated at the yeild method.
def self.invite!(attributes = {}, invited_by = nil, &block)
super do |invitable|
invitable.user = special_user
end
end
Top comments (0)