/ Published in: Rails
Expand |
Embed | Plain Text
class Playerquest < ActiveRecord::Base belongs_to :player belongs_to :quest after_create :get_children def get_children children = Quest.find_all_by_parent(self.quest_id) children.each do |child| Playerquest.create(:player_id => self.player_id, :quest_id => child.id) end end end
You need to login to post a comment.
