Support for subforums (#3831).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10142 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-07-31 17:17:52 +00:00
parent 9554f0133f
commit bc153cb61d
18 changed files with 210 additions and 14 deletions
+11
View File
@@ -99,4 +99,15 @@ module ObjectHelpers
source.save!
source
end
def Board.generate!(attributes={})
@generated_board_name ||= 'Forum 0'
@generated_board_name.succ!
board = Board.new(attributes)
board.name = @generated_board_name if board.name.blank?
board.description = @generated_board_name if board.description.blank?
yield board if block_given?
board.save!
board
end
end