mirror of
https://github.com/redmine/redmine.git
synced 2025-11-03 20:06:24 +01:00
Link to attachment should return latest attachment (#7510).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11196 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -129,4 +129,16 @@ module ObjectHelpers
|
||||
board.save!
|
||||
board
|
||||
end
|
||||
|
||||
def Attachment.generate!(attributes={})
|
||||
@generated_filename ||= 'testfile0'
|
||||
@generated_filename.succ!
|
||||
attributes = attributes.dup
|
||||
attachment = Attachment.new(attributes)
|
||||
attachment.container ||= Issue.find(1)
|
||||
attachment.author ||= User.find(2)
|
||||
attachment.filename = @generated_filename if attachment.filename.blank?
|
||||
attachment.save!
|
||||
attachment
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user