2014-05-21 16:45:11 +08:00
|
|
|
class AppliedProject < ActiveRecord::Base
|
|
|
|
attr_accessible :project_id, :user_id
|
|
|
|
|
|
|
|
belongs_to :user
|
2014-05-22 11:58:43 +08:00
|
|
|
belongs_to :project
|
|
|
|
|
|
|
|
#删除用户申请
|
|
|
|
def self.deleteappiled(userid, projectid)
|
|
|
|
@applieds = AppliedProject.where("user_id = ? and project_id = ?", userid, projectid)
|
|
|
|
@applieds.each do |applied|
|
|
|
|
applied.destroy
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-05-21 16:45:11 +08:00
|
|
|
end
|