summaryrefslogtreecommitdiffstats
path: root/app/models/document.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-05-15 23:52:48 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-05-15 23:52:48 +0000
commit674a61dc8e03f0efd1cf500d5b92045704ad119a (patch)
treebace3c43ce649d4a9c92b80da251a8f2c6ca892b /app/models/document.rb
parentb829acfb4a9983673db6fe2b535327334ff9d223 (diff)
downloadredmine-674a61dc8e03f0efd1cf500d5b92045704ad119a.tar.gz
redmine-674a61dc8e03f0efd1cf500d5b92045704ad119a.zip
remove trailing white-spaces from Document model source.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5794 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/document.rb')
-rw-r--r--app/models/document.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/app/models/document.rb b/app/models/document.rb
index d51f2d328..f8ea92a11 100644
--- a/app/models/document.rb
+++ b/app/models/document.rb
@@ -1,16 +1,16 @@
-# redMine - project management software
-# Copyright (C) 2006 Jean-Philippe Lang
+# RedMine - project management software
+# Copyright (C) 2006-2011 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -25,23 +25,23 @@ class Document < ActiveRecord::Base
:author => Proc.new {|o| (a = o.attachments.find(:first, :order => "#{Attachment.table_name}.created_on ASC")) ? a.author : nil },
:url => Proc.new {|o| {:controller => 'documents', :action => 'show', :id => o.id}}
acts_as_activity_provider :find_options => {:include => :project}
-
+
validates_presence_of :project, :title, :category
validates_length_of :title, :maximum => 60
-
+
named_scope :visible, lambda {|*args| { :include => :project,
:conditions => Project.allowed_to_condition(args.shift || User.current, :view_documents, *args) } }
-
+
def visible?(user=User.current)
!user.nil? && user.allowed_to?(:view_documents, project)
end
-
+
def after_initialize
if new_record?
self.category ||= DocumentCategory.default
end
end
-
+
def updated_on
unless @updated_on
a = attachments.find(:first, :order => 'created_on DESC')