diff options
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)
|