summaryrefslogtreecommitdiffstats
path: root/app/models/attachment.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-20 15:40:16 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-20 15:40:16 +0000
commit987a5aa22114ec2e931464782351431e4dfec97c (patch)
tree57af15078250c620d494306c251ad66af779bc0b /app/models/attachment.rb
parent99f9aea80a2bc43cdfc2933728f0ab72d7bf99d5 (diff)
downloadredmine-987a5aa22114ec2e931464782351431e4dfec97c.tar.gz
redmine-987a5aa22114ec2e931464782351431e4dfec97c.zip
Anonymous users can now be allowed to create, edit, comment issues, comment news and post messages in the forums.
These permissions need to be explicitly given to the Anonymous role (Admin -> Roles & Permissions -> Anonymous). git-svn-id: http://redmine.rubyforge.org/svn/trunk@919 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/attachment.rb')
-rw-r--r--app/models/attachment.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index d2bcab33f..7262498c4 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 :container, :filename
+ validates_presence_of :container, :filename, :author
validates_length_of :filename, :maximum => 255
validates_length_of :disk_filename, :maximum => 255
@@ -82,11 +82,6 @@ class Attachment < ActiveRecord::Base
def increment_download
increment!(:downloads)
end
-
- # returns last created projects
- def self.most_downloaded
- find(:all, :limit => 5, :order => "downloads DESC")
- end
def project
container.is_a?(Project) ? container : container.project