socialforge/app/models/applied_project.rb

16 lines
356 B
Ruby
Raw Normal View History

class AppliedProject < ActiveRecord::Base
attr_accessible :project_id, :user_id
belongs_to :user
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
end