diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2006-12-16 16:31:11 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2006-12-16 16:31:11 +0000 |
commit | bee3f353fca4031268536c1cc4349014f5b8ac62 (patch) | |
tree | 63c0271a9f17d3f964eadd1ab9da0cedd7006d7d /app/models/attachment.rb | |
parent | 005f4baaa4efa0dec6d8fe7ca213f414857bb968 (diff) | |
download | redmine-bee3f353fca4031268536c1cc4349014f5b8ac62.tar.gz redmine-bee3f353fca4031268536c1cc4349014f5b8ac62.zip |
fixed bug when no version is selected in projects/add_file
git-svn-id: http://redmine.rubyforge.org/svn/trunk@97 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/attachment.rb')
-rw-r--r-- | app/models/attachment.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 2e1e9b156..aca86cec5 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -21,7 +21,7 @@ class Attachment < ActiveRecord::Base belongs_to :container, :polymorphic => true
belongs_to :author, :class_name => "User", :foreign_key => "author_id"
- validates_presence_of :filename
+ validates_presence_of :container, :filename
def file=(incomming_file)
unless incomming_file.nil?
@@ -35,6 +35,10 @@ class Attachment < ActiveRecord::Base end
end
+ def file
+ nil
+ end
+
# Copy temp file to its final location
def before_save
if @temp_file && (@temp_file.size > 0)
|