app/models/user.rb
#
# Marks the invitation as redeemed.
#
Marks the invitation as redeemed.
Marks the invitation as redeemed .
def redeem_invitation
    arel       = Invitation.arel_table
    invitation = Invitation.find_by(arel[:email].matches(self.email))
    invitation.update(redeemed: true) unless invitation.nil?
  end
def redeem_invitation arel = Invitation . arel_table invitation = Invitation . find_by ( arel [ :email ] . matches ( self . email ) ) invitation . update ( redeemed : true ) unless invitation . nil? end
Marks the invitation as redeemed.
Marks the invitation as redeemed .
# If we use self.invitation.update here, it causes a problem because we are still in the create transaction.