Mercurial > hg > soundsoftware-site
comparison app/models/.svn/text-base/attachment.rb.svn-base @ 210:0579821a129a
Update to Redmine trunk rev 4802
author | Chris Cannam |
---|---|
date | Tue, 08 Feb 2011 13:51:46 +0000 |
parents | 513646585e45 |
children | cbce1fd3b1b7 |
comparison
equal
deleted
inserted
replaced
128:07fa8a8b56a8 | 210:0579821a129a |
---|---|
41 :find_options => {:select => "#{Attachment.table_name}.*", | 41 :find_options => {:select => "#{Attachment.table_name}.*", |
42 :joins => "LEFT JOIN #{Document.table_name} ON #{Attachment.table_name}.container_type='Document' AND #{Document.table_name}.id = #{Attachment.table_name}.container_id " + | 42 :joins => "LEFT JOIN #{Document.table_name} ON #{Attachment.table_name}.container_type='Document' AND #{Document.table_name}.id = #{Attachment.table_name}.container_id " + |
43 "LEFT JOIN #{Project.table_name} ON #{Document.table_name}.project_id = #{Project.table_name}.id"} | 43 "LEFT JOIN #{Project.table_name} ON #{Document.table_name}.project_id = #{Project.table_name}.id"} |
44 | 44 |
45 cattr_accessor :storage_path | 45 cattr_accessor :storage_path |
46 @@storage_path = "#{RAILS_ROOT}/files" | 46 @@storage_path = Redmine::Configuration['attachments_storage_path'] || "#{RAILS_ROOT}/files" |
47 | 47 |
48 def validate | 48 def validate |
49 if self.filesize > Setting.attachment_max_size.to_i.kilobytes | 49 if self.filesize > Setting.attachment_max_size.to_i.kilobytes |
50 errors.add(:base, :too_long, :count => Setting.attachment_max_size.to_i.kilobytes) | 50 errors.add(:base, :too_long, :count => Setting.attachment_max_size.to_i.kilobytes) |
51 end | 51 end |