mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FEATURE: redeem Invite when user sign up
This commit is contained in:
parent
0de564f598
commit
b301391116
3 changed files with 14 additions and 0 deletions
|
@ -130,6 +130,14 @@ class Invite < ActiveRecord::Base
|
|||
i
|
||||
end
|
||||
|
||||
def self.redeem_from_email(email)
|
||||
invite = Invite.find_by(email: Email.downcase(email))
|
||||
if invite
|
||||
InviteRedeemer.new(invite).redeem
|
||||
end
|
||||
invite
|
||||
end
|
||||
|
||||
def self.base_directory
|
||||
File.join(Rails.root, "public", "csv", RailsMultisite::ConnectionManagement.current_db)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue