make invites default to 5 again

This commit is contained in:
maxwell 2011-01-27 10:35:43 -08:00
parent bd6617ea55
commit a705824b0c

View file

@ -54,7 +54,7 @@ class Invitation < ActiveRecord::Base
def self.create_invitee(opts = {})
invitee = opts[:existing_user] || new_user_by_service_and_identifier(opts[:service], opts[:identifier])
return invitee if opts[:service] == 'email' && !opts[:identifier].match(Devise.email_regexp)
invitee.invites = opts[:invites] || 0
invitee.invites = opts[:invites] || 5
if invitee.new_record?
invitee.errors.clear
invitee.serialized_private_key ||= User.generate_key