Skip to content

Instantly share code, notes, and snippets.

@bplexico
Created May 31, 2013 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bplexico/5687565 to your computer and use it in GitHub Desktop.
Save bplexico/5687565 to your computer and use it in GitHub Desktop.
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