I have a rails app where I want only Users
with an activation code could get a confirmation email, otherwise they will just be registered and not get confirmation email.
Here is what I'm planning to do, would this be something that would work ?
class RegistrationsController < Devise::RegistrationsController
def create
if resource.activation_code == "ActivationCode"
super
else
user = User.new(resource)
user.skip_confirmation!
user.save
end
end
end