summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/attachment.rb2
-rw-r--r--test/unit/attachment_test.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index 2b13118b1..db80db396 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -152,7 +152,7 @@ class Attachment < ActiveRecord::Base
end
def title
- title = filename.to_s
+ title = filename.dup
if description.present?
title << " (#{description})"
end
diff --git a/test/unit/attachment_test.rb b/test/unit/attachment_test.rb
index c2f612405..45061fe48 100644
--- a/test/unit/attachment_test.rb
+++ b/test/unit/attachment_test.rb
@@ -242,6 +242,7 @@ class AttachmentTest < ActiveSupport::TestCase
a = Attachment.new(:filename => "test.png", :description => "Cool image")
assert_equal "test.png (Cool image)", a.title
+ assert_equal "test.png", a.filename
end
def test_new_attachment_should_be_editable_by_author