diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-07-16 17:16:49 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-07-16 17:16:49 +0000 |
commit | fcefdb22bfc3a270e213e289c562bea0bd8722ef (patch) | |
tree | 17b14373e732950cc918883df746e89a33d1373d /app/models/attachment.rb | |
parent | 7363428703e4a86c3c7b20e5adc00e9ae9428b2e (diff) | |
download | redmine-fcefdb22bfc3a270e213e289c562bea0bd8722ef.tar.gz redmine-fcefdb22bfc3a270e213e289c562bea0bd8722ef.zip |
Added several validates_length_of
git-svn-id: http://redmine.rubyforge.org/svn/trunk@593 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/attachment.rb')
-rw-r--r-- | app/models/attachment.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 2be4e1639..b1a7c529f 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -22,7 +22,9 @@ class Attachment < ActiveRecord::Base belongs_to :author, :class_name => "User", :foreign_key => "author_id" validates_presence_of :container, :filename - + validates_length_of :filename, :maximum => 255 + validates_length_of :disk_filename, :maximum => 255 + cattr_accessor :storage_path @@storage_path = "#{RAILS_ROOT}/files" |