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
This commit is contained in:
Jean-Philippe Lang
2006-12-16 16:31:11 +00:00
parent 005f4baaa4
commit bee3f353fc
3 changed files with 20 additions and 18 deletions
+5 -1
View File
@@ -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)