remove unneeded condition from invite model

This commit is contained in:
Arpit Jalan 2017-07-01 21:50:34 +05:30
parent 4fb9269642
commit d3ee5752b8
1 changed files with 2 additions and 2 deletions

View File

@ -253,13 +253,13 @@ class Invite < ActiveRecord::Base
def self.resend_all_invites_from(user_id)
Invite.where('invites.user_id IS NULL AND invites.email IS NOT NULL AND invited_by_id = ?', user_id).find_each do |invite|
invite.resend_invite unless invite.blank?
invite.resend_invite
end
end
def self.rescind_all_invites_from(user)
Invite.where('invites.user_id IS NULL AND invites.email IS NOT NULL AND invited_by_id = ?', user.id).find_each do |invite|
invite.trash!(user) unless invite.blank?
invite.trash!(user)
end
end