Disable confirmation email for guest user

This commit is contained in:
saurabhbhatia 2014-01-03 17:35:56 +08:00
parent e4cc6d543b
commit c62b8d4d37
1 changed files with 3 additions and 2 deletions

View File

@ -28,9 +28,10 @@ module ApplicationHelper
def create_guest_user
u = nil
User.without_callback(:create, :before, :initialize_desktop) do
u = User.create(:name => "guest", :email => "guest_#{Time.now.to_i}#{rand(99)}@example.com")
u = User.create(:name => "guest", :email => "guest_#{Time.now.to_i}#{rand(99)}@example.com")
end
u.admin = false
u.admin = false
u.skip_confirmation!
u.save(:validate => false)
u
end