start people off with invites if the pod is open
This commit is contained in:
parent
728d0537cb
commit
23d6441d77
2 changed files with 2 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ class RegistrationsController < Devise::RegistrationsController
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@user = User.build(params[:user])
|
@user = User.build(params[:user])
|
||||||
|
@user.invites = 20
|
||||||
if @user.save
|
if @user.save
|
||||||
flash[:notice] = I18n.t 'registrations.create.success'
|
flash[:notice] = I18n.t 'registrations.create.success'
|
||||||
@user.seed_aspects
|
@user.seed_aspects
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ class Invitation < ActiveRecord::Base
|
||||||
def self.create_invitee(opts = {})
|
def self.create_invitee(opts = {})
|
||||||
invitee = opts[:existing_user] || new_user_by_service_and_identifier(opts[:service], opts[:identifier])
|
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)
|
return invitee if opts[:service] == 'email' && !opts[:identifier].match(Devise.email_regexp)
|
||||||
invitee.invites = opts[:invites] || 5
|
invitee.invites = opts[:invites] || 10
|
||||||
if invitee.new_record?
|
if invitee.new_record?
|
||||||
invitee.errors.clear
|
invitee.errors.clear
|
||||||
invitee.serialized_private_key = User.generate_key if invitee.serialized_private_key.blank?
|
invitee.serialized_private_key = User.generate_key if invitee.serialized_private_key.blank?
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue