engines/adva_forum/app/models/board.rb
# Called when a board is deleted. When this is the last board the topics are moved to the forum.
# This is so the user is able to revert the process of creating a board when there already are
# topics on the forum.
Called when a board is deleted. When this is the last board the topics are moved to the forum.
This is so the user is able to revert the process of creating a board when there already are
topics on the forum.
Called when a board is deleted . When this is the last board the topics are moved to the forum . This is so the user is able to revert the process of creating a board when there already are topics on the forum .
def unassign_topics
    return unless last?
    topics.each do |topic|
      topic.update_attribute(:board_id, nil)
      topic.posts.each do |post|
        post.update_attribute(:board_id, nil)
      end
    end
  end
def unassign_topics return unless last? topics . each do | topic | topic . update_attribute ( :board_id , nil ) topic . posts . each do | post | post . update_attribute ( :board_id , nil ) end end end
Called when a board is deleted.
Called when a board is deleted .