diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/document.rb | 3 | ||||
-rw-r--r-- | app/models/document_custom_field.rb | 22 |
2 files changed, 24 insertions, 1 deletions
diff --git a/app/models/document.rb b/app/models/document.rb index 29f9031fc..d6b96ac98 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -20,6 +20,7 @@ class Document < ActiveRecord::Base belongs_to :project belongs_to :category, :class_name => "DocumentCategory" acts_as_attachable :delete_permission => :delete_documents + acts_as_customizable acts_as_searchable :columns => ['title', "#{table_name}.description"], :preload => :project @@ -39,7 +40,7 @@ class Document < ActiveRecord::Base where(Project.allowed_to_condition(args.shift || User.current, :view_documents, *args)) } - safe_attributes 'category_id', 'title', 'description' + safe_attributes 'category_id', 'title', 'description', 'custom_fields', 'custom_field_values' def visible?(user=User.current) !user.nil? && user.allowed_to?(:view_documents, project) diff --git a/app/models/document_custom_field.rb b/app/models/document_custom_field.rb new file mode 100644 index 000000000..3ea9d10b5 --- /dev/null +++ b/app/models/document_custom_field.rb @@ -0,0 +1,22 @@ +# Redmine - project management software +# Copyright (C) 2006-2015 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. + +class DocumentCustomField < CustomField + def type_name + :label_document_plural + end +end |