Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Extract mark_invite_redeemed
if mark_invite_redeemed == 1
...
private
def mark_invite_redeemed
Invite.update_all('redeemed_at = CURRENT_TIMESTAMP',
['id = ? AND redeemed_at IS NULL AND created_at >= ?', invite.id, SiteSetting.invite_expiry_days.days.ago])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment