trustieforge/app/models/invite_list.rb

14 lines
375 B
Ruby

class InviteList < ActiveRecord::Base
attr_accessible :project_id, :user_id, :mail
belongs_to :user
belongs_to :project
# 用户拒绝邀请后,删除记录
def self.delete_inviter(userid, projectid)
@inviters = AppliedProject.where("user_id = ? and project_id = ?", userid, projectid)
@inviters.each do |inviter|
inviter.destroy
end
end
end